changeset 195:797299e9fffc stable-6-0-15

fix null dereference if missing _ macro
author carl
date Fri, 07 Dec 2007 16:59:41 -0800
parents 688ec12a3c0c
children ff6d14d75b1e
files AUTHORS ChangeLog NEWS configure.in src/context.cpp
diffstat 5 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Sun Nov 11 13:21:48 2007 -0800
+++ b/AUTHORS	Fri Dec 07 16:59:41 2007 -0800
@@ -8,3 +8,4 @@
     Jeff Evans <jeffe@tricab.com>
     G.W. Haywood <ged@jubileegroup.co.uk>
     Georg C. F. Greve <greve@gnu.org> - spamassassin milter
+    Hewitt, Ivor <Ivor.Hewitt@MorganStanley.com>
--- a/ChangeLog	Sun Nov 11 13:21:48 2007 -0800
+++ b/ChangeLog	Fri Dec 07 16:59:41 2007 -0800
@@ -1,5 +1,9 @@
     $Id$
 
+6.15 2007-12-07
+    Fix null pointer dereference if macro _ not passed to this milter.
+    Default sendmail config passes that in the connect call.
+
 6.14 2007-11-11
     Delay auto whitelisting until we see the headers, to prevent
     auto whitelisting due to bulk out of office reply bots.
--- a/NEWS	Sun Nov 11 13:21:48 2007 -0800
+++ b/NEWS	Fri Dec 07 16:59:41 2007 -0800
@@ -1,6 +1,7 @@
     $Id$
 
-6.13 2007-11-10 Don't autowhitelist due to out of office reply bots.
+6.15 2007-12-07 Fix null pointer dereference if macro _ not passed to this milter.
+6.14 2007-11-10 Don't autowhitelist due to out of office reply bots.
 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.
--- a/configure.in	Sun Nov 11 13:21:48 2007 -0800
+++ b/configure.in	Fri Dec 07 16:59:41 2007 -0800
@@ -1,6 +1,6 @@
 
 AC_PREREQ(2.59)
-AC_INIT(dnsbl,6.14,carl@five-ten-sg.com)
+AC_INIT(dnsbl,6.15,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 
--- a/src/context.cpp	Sun Nov 11 13:21:48 2007 -0800
+++ b/src/context.cpp	Fri Dec 07 16:59:41 2007 -0800
@@ -486,10 +486,7 @@
             if (when < limit) {
                 char *who = (*i).first;
                 free(who);
-                autowhite_sent::iterator j = i;
-                j++;
-                rcpts.erase(i);
-                i = j;
+                rcpts.erase(i++);
                 need = true;
             }
             else i++;
@@ -756,6 +753,7 @@
 
 char *CONTEXT::generic_match(char *client)
 {
+    if (!client) return NULL;   // allow missing _ macro, which will disable generic checking
     if (parent && !generic_regx) return parent->generic_match(client);
     if (!generic_regx)           return NULL;
     if (0 == regexec(&generic_pattern, client, 0, NULL, 0)) {