comparison 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
comparison
equal deleted inserted replaced
190:004b855c6c1f 191:2a67d31099c3
985 return SMFIS_CONTINUE; 985 return SMFIS_CONTINUE;
986 } 986 }
987 987
988 sfsistat mlfi_helo(SMFICTX * ctx, char *helohost) 988 sfsistat mlfi_helo(SMFICTX * ctx, char *helohost)
989 { 989 {
990 mlfiPriv &priv = *MLFIPRIV; 990 mlfiPriv &priv = *MLFIPRIV;
991 priv.helo = (helohost) ? strdup(helohost) : strdup("missing"); 991 priv.helo = strdup(helohost);
992 return SMFIS_CONTINUE; 992 return SMFIS_CONTINUE;
993 } 993 }
994 994
995 sfsistat mlfi_envfrom(SMFICTX *ctx, char **from) 995 sfsistat mlfi_envfrom(SMFICTX *ctx, char **from)
996 { 996 {
997 mlfiPriv &priv = *MLFIPRIV; 997 mlfiPriv &priv = *MLFIPRIV;
998 priv.mailaddr = to_lower_string(from[0]); 998 priv.mailaddr = to_lower_string(from[0]);
999 priv.queueid = strdup(smfi_getsymval(ctx, "i")); 999 priv.queueid = strdup(smfi_getsymval(ctx, "i"));
1000 priv.authenticated = smfi_getsymval(ctx, "{auth_authen}"); 1000 priv.authenticated = smfi_getsymval(ctx, "{auth_authen}");
1001 priv.client_name = smfi_getsymval(ctx, "_"); 1001 priv.client_name = smfi_getsymval(ctx, "_");
1002 if (!priv.helo) priv.helo = strdup("unknown");
1002 if (priv.authenticated) priv.authenticated = strdup(priv.authenticated); 1003 if (priv.authenticated) priv.authenticated = strdup(priv.authenticated);
1003 if (priv.client_name) priv.client_name = strdup(priv.client_name); 1004 if (priv.client_name) priv.client_name = strdup(priv.client_name);
1004 if (spamc != spamc_empty) { 1005 if (spamc != spamc_empty) {
1005 priv.assassin = new SpamAssassin(&priv, priv.ip, priv.helo, priv.mailaddr, priv.queueid); 1006 priv.assassin = new SpamAssassin(&priv, priv.ip, priv.helo, priv.mailaddr, priv.queueid);
1006 } 1007 }