summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-03-06 23:32:35 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-03-06 23:32:35 +0000
commite06de7b392fe4648cb926c977a9816c7075f1594 (patch)
treee06ea10cada161c7067375c190cf9ed1fe85a4be /usr.sbin
parent8dd6d0a64f54d9f50d7c224715b3cba1d1b39971 (diff)
make_plain() deals with a c-string, val->size should contain the nul-byte
or we will truncate the last character of every value we store in a map.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/makemap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c
index 30637fc136f..c73828754d7 100644
--- a/usr.sbin/smtpd/makemap.c
+++ b/usr.sbin/smtpd/makemap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: makemap.c,v 1.12 2009/03/06 23:29:06 gilles Exp $ */
+/* $OpenBSD: makemap.c,v 1.13 2009/03/06 23:32:34 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -281,6 +281,11 @@ make_plain(DBT *val, char *text)
return 0;
}
+ /* unlike make_aliases, we deal with a C string, so
+ * val->size should include the nul-byte.
+ */
+ val->size++;
+
return (val->size);
}