Mercurial > dnsbl
comparison src/dnsbl.cpp @ 190:004b855c6c1f
fix null pointer dereference from missing HELO command
author | carl |
---|---|
date | Sat, 10 Nov 2007 10:52:50 -0800 |
parents | edcefdb7ccc1 |
children | 2a67d31099c3 |
comparison
equal
deleted
inserted
replaced
189:e10f5951b905 | 190:004b855c6c1f |
---|---|
242 pthread_mutex_lock(&config_mutex); | 242 pthread_mutex_lock(&config_mutex); |
243 pc = config; | 243 pc = config; |
244 pc->reference_count++; | 244 pc->reference_count++; |
245 pthread_mutex_unlock(&config_mutex); | 245 pthread_mutex_unlock(&config_mutex); |
246 get_fd(); | 246 get_fd(); |
247 ctx = NULL; | |
248 eom = false; | |
247 ip = 0; | 249 ip = 0; |
248 helo = NULL; | 250 helo = NULL; |
249 mailaddr = NULL; | 251 mailaddr = NULL; |
250 queueid = NULL; | 252 queueid = NULL; |
251 authenticated = NULL; | 253 authenticated = NULL; |
287 if (memory) delete memory; | 289 if (memory) delete memory; |
288 if (scanner) delete scanner; | 290 if (scanner) delete scanner; |
289 if (assassin) delete assassin; | 291 if (assassin) delete assassin; |
290 if (dccifd) delete dccifd; | 292 if (dccifd) delete dccifd; |
291 if (!final) { | 293 if (!final) { |
294 ctx = NULL; | |
295 eom = false; | |
292 mailaddr = NULL; | 296 mailaddr = NULL; |
293 queueid = NULL; | 297 queueid = NULL; |
294 authenticated = NULL; | 298 authenticated = NULL; |
295 client_name = NULL; | 299 client_name = NULL; |
296 have_whites = false; | 300 have_whites = false; |
566 // | 570 // |
567 int dns_interface(mlfiPriv &priv, char *question, bool maybe_ip, ns_map *nameservers); | 571 int dns_interface(mlfiPriv &priv, char *question, bool maybe_ip, ns_map *nameservers); |
568 int dns_interface(mlfiPriv &priv, char *question, bool maybe_ip, ns_map *nameservers) { | 572 int dns_interface(mlfiPriv &priv, char *question, bool maybe_ip, ns_map *nameservers) { |
569 // tell sendmail we are still working | 573 // tell sendmail we are still working |
570 #if _FFR_SMFI_PROGRESS | 574 #if _FFR_SMFI_PROGRESS |
571 smfi_progress(priv.ctx); | 575 if (priv.eom) smfi_progress(priv.ctx); |
572 #endif | 576 #endif |
573 | 577 |
574 // this part can be done without locking the resolver mutex. Each | 578 // this part can be done without locking the resolver mutex. Each |
575 // milter thread is talking over its own socket to a separate resolver | 579 // milter thread is talking over its own socket to a separate resolver |
576 // process, which does the actual dns resolution. | 580 // process, which does the actual dns resolution. |
1184 CONFIG &dc = *priv.pc; | 1188 CONFIG &dc = *priv.pc; |
1185 char *host = NULL; | 1189 char *host = NULL; |
1186 int ip; | 1190 int ip; |
1187 status st; | 1191 status st; |
1188 // process end of message | 1192 // process end of message |
1193 priv.eom = true; | |
1189 if (priv.authenticated || priv.only_whites) rc = SMFIS_CONTINUE; | 1194 if (priv.authenticated || priv.only_whites) rc = SMFIS_CONTINUE; |
1190 else { | 1195 else { |
1191 // assert env_to not empty, it contains the | 1196 // assert env_to not empty, it contains the |
1192 // non-whitelisted folks that want content filtering | 1197 // non-whitelisted folks that want content filtering |
1193 int score = (priv.want_spamassassin) ? priv.assassin->mlfi_eom() : 0; | 1198 int score = (priv.want_spamassassin) ? priv.assassin->mlfi_eom() : 0; |