diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-03-06 23:32:35 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-03-06 23:32:35 +0000 |
commit | e06de7b392fe4648cb926c977a9816c7075f1594 (patch) | |
tree | e06ea10cada161c7067375c190cf9ed1fe85a4be /usr.sbin | |
parent | 8dd6d0a64f54d9f50d7c224715b3cba1d1b39971 (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.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); } |