diff options
author | John Denker <jsd@av8n.com> | 2012-06-02 23:59:53 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2012-06-02 23:59:53 -0700 |
commit | cbf5fd559293f7f5b59996a5845c0080e9946f01 (patch) | |
tree | 2fa38cfb3983a7b19f1e8f0396b77502a8d3fb36 | |
parent | b8caf78e0ae86118cd0659e28da919721106eadb (diff) |
catch insidious syntax error
-rw-r--r-- | qmail-smtpd.c | 3 |
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; } |