diff 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
line wrap: on
line diff
--- a/src/dnsbl.cpp	Sat Nov 10 10:41:04 2007 -0800
+++ b/src/dnsbl.cpp	Sat Nov 10 10:52:50 2007 -0800
@@ -244,6 +244,8 @@
 		pc->reference_count++;
 	pthread_mutex_unlock(&config_mutex);
 	get_fd();
+    ctx                 = NULL;
+    eom                 = false;
 	ip					= 0;
 	helo				= NULL;
 	mailaddr			= NULL;
@@ -289,6 +291,8 @@
 	if (assassin) delete assassin;
 	if (dccifd)   delete dccifd;
 	if (!final) {
+        ctx                 = NULL;
+        eom                 = false;
 		mailaddr			= NULL;
 		queueid 			= NULL;
 		authenticated		= NULL;
@@ -568,7 +572,7 @@
 int dns_interface(mlfiPriv &priv, char *question, bool maybe_ip, ns_map *nameservers) {
     // tell sendmail we are still working
     #if _FFR_SMFI_PROGRESS
-        smfi_progress(priv.ctx);
+        if (priv.eom) smfi_progress(priv.ctx);
     #endif
 
 	// this part can be done without locking the resolver mutex. Each
@@ -1186,6 +1190,7 @@
 	int 	  ip;
 	status	  st;
 	// process end of message
+    priv.eom = true;
 	if (priv.authenticated || priv.only_whites) rc = SMFIS_CONTINUE;
 	else {
 		// assert env_to not empty, it contains the