summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-02 23:59:53 -0700
committerJohn Denker <jsd@av8n.com>2012-06-02 23:59:53 -0700
commitcbf5fd559293f7f5b59996a5845c0080e9946f01 (patch)
tree2fa38cfb3983a7b19f1e8f0396b77502a8d3fb36
parentb8caf78e0ae86118cd0659e28da919721106eadb (diff)
catch insidious syntax error
-rw-r--r--qmail-smtpd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qmail-smtpd.c b/qmail-smtpd.c
index 7d062a2..1064008 100644
--- a/qmail-smtpd.c
+++ b/qmail-smtpd.c
@@ -171,6 +171,7 @@ char *arg;
arg += i + 1;
else { /* partner should go read rfc 821 */
terminator = ' ';
+/* The following fails insidiously if there's no ':' */
arg += str_chr(arg,':');
if (*arg == ':') ++arg;
while (*arg == ' ') ++arg;
@@ -211,7 +212,9 @@ char *arg;
}
}
+/* returning 0 will provoke a "555 syntax error" */
if (addr.len > 900) return 0;
+ if (addr.len == 0 || addr.s[0] == 0) return 0;
return 1;
}