diff options
author | 2009-03-06 23:32:34 +0000 | |
---|---|---|
committer | 2009-03-06 23:32:34 +0000 | |
commit | bee586e26c38fa05befec6ca2b88fdeefb39ecb5 (patch) | |
tree | 38b3b4831952305157dbc5ebb73f0806946087db /usr.sbin/smtpd/makemap.c | |
parent | fix a bug in the generation of plain maps which would cause the value not (diff) | |
download | wireguard-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.
Diffstat (limited to 'usr.sbin/smtpd/makemap.c')
-rw-r--r-- | usr.sbin/smtpd/makemap.c | 7 |
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); } |