summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2009-03-06 23:32:34 +0000
committergilles <gilles@openbsd.org>2009-03-06 23:32:34 +0000
commitbee586e26c38fa05befec6ca2b88fdeefb39ecb5 (patch)
tree38b3b4831952305157dbc5ebb73f0806946087db
parentfix a bug in the generation of plain maps which would cause the value not (diff)
downloadwireguard-openbsd-bee586e26c38fa05befec6ca2b88fdeefb39ecb5.tar.xz
wireguard-openbsd-bee586e26c38fa05befec6ca2b88fdeefb39ecb5.zip
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.
-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);
}