summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/table_db.c10
-rw-r--r--usr.sbin/smtpd/table_static.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/table_db.c b/usr.sbin/smtpd/table_db.c
index 732faf7a2d7..fe8647916ee 100644
--- a/usr.sbin/smtpd/table_db.c
+++ b/usr.sbin/smtpd/table_db.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_db.c,v 1.2 2013/01/31 18:34:43 eric Exp $ */
+/* $OpenBSD: table_db.c,v 1.3 2013/02/13 14:34:43 gilles Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
@@ -375,10 +375,14 @@ error:
static int
table_db_userinfo(const char *key, char *line, size_t len, void **retp)
{
- struct userinfo *userinfo;
+ struct userinfo *userinfo = NULL;
+ char buffer[1024];
+
+ if (! bsnprintf(buffer, sizeof buffer, "%s:%s", key, line))
+ goto error;
userinfo = xcalloc(1, sizeof *userinfo, "table_db_userinfo");
- if (! text_to_userinfo(userinfo, line))
+ if (! text_to_userinfo(userinfo, buffer))
goto error;
*retp = userinfo;
return 1;
diff --git a/usr.sbin/smtpd/table_static.c b/usr.sbin/smtpd/table_static.c
index c3bca6889fb..b4e9767d1b3 100644
--- a/usr.sbin/smtpd/table_static.c
+++ b/usr.sbin/smtpd/table_static.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_static.c,v 1.2 2013/02/05 15:23:40 gilles Exp $ */
+/* $OpenBSD: table_static.c,v 1.3 2013/02/13 14:34:43 gilles Exp $ */
/*
* Copyright (c) 2012 Gilles Chehade <gilles@poolp.org>
@@ -351,10 +351,14 @@ error:
static int
table_static_userinfo(const char *key, char *line, size_t len, void **retp)
{
- struct userinfo *userinfo;
+ struct userinfo *userinfo = NULL;
+ char buffer[1024];
+
+ if (! bsnprintf(buffer, sizeof buffer, "%s:%s", key, line))
+ goto error;
userinfo = xcalloc(1, sizeof *userinfo, "table_static_userinfo");
- if (! text_to_userinfo(userinfo, line))
+ if (! text_to_userinfo(userinfo, buffer))
goto error;
*retp = userinfo;
return 1;