summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2010-04-21 21:40:57 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2010-04-21 21:40:57 +0000
commitbad4ad66b980ce6b89cf7b3578cdfd3098b929b6 (patch)
tree2c1efb2214febdab22e541b3014ace60b9d899a9
parent757735efe62f07103391067f623429d1252de7db (diff)
when creating a map, make sure we do not store a key/val separator at the
beginning of the key (ie: "gilles: bleh" should not be stored as key[gilles] val[ bleh])
-rw-r--r--usr.sbin/smtpd/makemap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c
index a707c6220c2..e3217833a4a 100644
--- a/usr.sbin/smtpd/makemap.c
+++ b/usr.sbin/smtpd/makemap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: makemap.c,v 1.24 2009/11/08 23:08:56 gilles Exp $ */
+/* $OpenBSD: makemap.c,v 1.25 2010/04/21 21:40:56 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -255,6 +255,10 @@ parse_mapentry(char *line, size_t len, size_t lineno)
strsep(&valp, " \t:");
if (valp == NULL || valp == keyp)
goto bad;
+ while (*valp == ':' || isspace((int)*valp))
+ valp++;
+ if (*valp == '\0' || *valp == '#')
+ goto bad;
/* Check for dups. */
key.data = keyp;