changeset 187:f0eda59e8afd

fix null pointer dereference from missing HELO command
author carl
date Sat, 10 Nov 2007 10:20:54 -0800
parents 2a80c9b5d2c9
children edcefdb7ccc1
files ChangeLog NEWS configure.in src/dnsbl.cpp src/dnsbl.h xml/dnsbl.in
diffstat 6 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Nov 10 10:20:54 2007 -0800
+++ b/ChangeLog	Sat Nov 10 10:20:54 2007 -0800
@@ -1,5 +1,10 @@
     $Id$
 
+6.13 2007-11-10
+    HELO command is optional, and if missing caused a null pointer
+    dereference. Add configure detection for sendmail progress
+    callback, to allow smfi_progress() call during dns lookups.
+
 6.12 2007-10-13
     SMTP rejections take precedence over greylisting.
 
--- a/NEWS	Sat Nov 10 10:20:54 2007 -0800
+++ b/NEWS	Sat Nov 10 10:20:54 2007 -0800
@@ -1,5 +1,6 @@
     $Id$
 
+6.13 2007-11-10 Fix null pointer dereference on missing HELO command.
 6.12 2007-10-13 SMTP rejections take precedence over greylisting.
 6.11 2007-10-07 Add DCC filtering via dccifd. Fix static buffer referenced by multiple threads.
 6.10 2007-09-23 Don't whitelist addresses with embedded blanks, or the empty path.
--- a/configure.in	Sat Nov 10 10:20:54 2007 -0800
+++ b/configure.in	Sat Nov 10 10:20:54 2007 -0800
@@ -1,6 +1,6 @@
 
 AC_PREREQ(2.59)
-AC_INIT(dnsbl,6.12,carl@five-ten-sg.com)
+AC_INIT(dnsbl,6.13,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 
@@ -45,6 +45,15 @@
 # check for posix threads
 ACX_PTHREAD
 
+# See if we have progress callback
+AC_CHECK_LIB([milter],
+             [smfi_progress],
+             [AC_DEFINE(_FFR_SMFI_PROGRESS, 1, Define to 1 to enable progress callback)],
+             [AC_DEFINE(_FFR_SMFI_PROGRESS, 0, Define to 1 to enable progress callback)],
+    	     [-lpthread]
+             )
+
+
 AC_CONFIG_FILES([Makefile
                  dnsbl.rc
                  dnsbl.spec
--- a/src/dnsbl.cpp	Sat Nov 10 10:20:54 2007 -0800
+++ b/src/dnsbl.cpp	Sat Nov 10 10:20:54 2007 -0800
@@ -429,7 +429,7 @@
 mlfiPriv* fetch_priv_from_ctx(SMFICTX *ctx)
 {
     mlfiPriv *priv = (struct mlfiPriv *)smfi_getpriv(ctx);
-    priv.ctx = ctx;
+    priv->ctx = ctx;
     return priv;
 }
 #define MLFIPRIV    fetch_priv_from_ctx(ctx)
--- a/src/dnsbl.h	Sat Nov 10 10:20:54 2007 -0800
+++ b/src/dnsbl.h	Sat Nov 10 10:20:54 2007 -0800
@@ -24,6 +24,8 @@
 //
 struct mlfiPriv
 {
+    // callback specific data
+    SMFICTX *ctx;                           // updated everytime we fetch this priv pointer from the ctx
 	// connection specific data
 	CONFIG	*pc;							// global filtering configuration
 	int 	fd; 							// to talk to dns resolver process
--- a/xml/dnsbl.in	Sat Nov 10 10:20:54 2007 -0800
+++ b/xml/dnsbl.in	Sat Nov 10 10:20:54 2007 -0800
@@ -530,10 +530,6 @@
                 The following ideas are under consideration.
             </para>
             <para>
-                Add a per-context option to reject mail if the number of digits in
-                the reverse dns client name exceeds some threshold.
-            </para>
-            <para>
                 Look for href="hostname/path" strings that are missing the required
                 http:// protocol header. Such references are still clickable in common
                 mail software.