Fix @[] prefix matching bug.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Mon, 12 Sep 2005 14:03:42 +0000 (14:03 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Mon, 12 Sep 2005 14:03:42 +0000 (14:03 +0000)
doc/doc-txt/ChangeLog
src/src/match.c

index e510820be2bd415669d7d976e32ed81f9f074978..5ad040e4c2557b1de589ec3e20c0fe92bfef1eaa 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.222 2005/09/12 13:55:54 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.223 2005/09/12 14:03:42 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -167,6 +167,9 @@ PH/40 RM_COMMAND is now used in the building process.
 PH/41 Added a "distclean" target to the top-level Makefile; it deletes all
       the "build-* directories that it finds.
 
+PH/42 (But a TF fix): In a domain list, Exim incorrectly matched @[] if the IP
+      address in a domain literal was a prefix of an interface address.
+
 
 Exim version 4.52
 -----------------
index 18787e8acd63c95fcbe060c2bd0c31a114ba9b21..ace8e016e4cfd0488e87f8ca483db7697bfd9bca 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/match.c,v 1.9 2005/09/12 13:39:31 ph10 Exp $ */
+/* $Cambridge: exim/src/src/match.c,v 1.10 2005/09/12 14:03:42 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -174,7 +174,9 @@ if (cb->at_is_special && pattern[0] == '@')
     int slen = Ustrlen(s);
     if (s[0] != '[' && s[slen-1] != ']') return FAIL;
     for (ip = host_find_interfaces(); ip != NULL; ip = ip->next)
-      if (Ustrncmp(ip->address, s+1, slen - 2) == 0) return OK;
+      if (Ustrncmp(ip->address, s+1, slen - 2) == 0
+            && ip->address[slen - 2] == 0)
+        return OK;
     return FAIL;
     }