Mercurial > dnsbl
diff src/dnsbl.cpp @ 191:2a67d31099c3 stable-6-0-13
fix null pointer dereference from missing HELO command
author | carl |
---|---|
date | Sat, 10 Nov 2007 16:20:51 -0800 |
parents | 004b855c6c1f |
children | 8f4a9a37d4d9 |
line wrap: on
line diff
--- a/src/dnsbl.cpp Sat Nov 10 10:52:50 2007 -0800 +++ b/src/dnsbl.cpp Sat Nov 10 16:20:51 2007 -0800 @@ -988,7 +988,7 @@ sfsistat mlfi_helo(SMFICTX * ctx, char *helohost) { mlfiPriv &priv = *MLFIPRIV; - priv.helo = (helohost) ? strdup(helohost) : strdup("missing"); + priv.helo = strdup(helohost); return SMFIS_CONTINUE; } @@ -999,6 +999,7 @@ priv.queueid = strdup(smfi_getsymval(ctx, "i")); priv.authenticated = smfi_getsymval(ctx, "{auth_authen}"); priv.client_name = smfi_getsymval(ctx, "_"); + if (!priv.helo) priv.helo = strdup("unknown"); if (priv.authenticated) priv.authenticated = strdup(priv.authenticated); if (priv.client_name) priv.client_name = strdup(priv.client_name); if (spamc != spamc_empty) {