ph10 2005/08/08 10:57:30 BST
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src expand.c
exim-test-orig/AutoTest/confs 082
exim-test-orig/AutoTest/scripts 082
exim-test-orig/AutoTest/stderr 082
exim-test-orig/AutoTest/stdout 082
Log:
Fix memory bug (could segfault) for $reply_address when Reply-to: is
empty and From: does not exist.
Revision Changes Path
1.199 +3 -0 exim/exim-doc/doc-txt/ChangeLog
1.40 +3 -0 exim/exim-src/src/expand.c
1.3 +11 -0 exim/exim-test-orig/AutoTest/confs/082
1.15 +31 -0 exim/exim-test-orig/AutoTest/scripts/082
1.3 +42 -0 exim/exim-test-orig/AutoTest/stderr/082
1.16 +27 -0 exim/exim-test-orig/AutoTest/stdout/082
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- ChangeLog 3 Aug 2005 09:29:24 -0000 1.198
+++ ChangeLog 8 Aug 2005 09:57:29 -0000 1.199
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.198 2005/08/03 09:29:24 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.199 2005/08/08 09:57:29 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -59,6 +59,9 @@
JJ/01 exipick: added $message_exim_id variable (see 4.53-PH/04)
TK/03 Fix log output including CR from clamd.
+
+PH/14 A reference to $reply_address when Reply-to: was empty and From: did not
+ exist provoked a memory error which could cause a segfault.
Exim version 4.52
Index: expand.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/expand.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- expand.c 1 Aug 2005 15:01:12 -0000 1.39
+++ expand.c 8 Aug 2005 09:57:29 -0000 1.40
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/expand.c,v 1.39 2005/08/01 15:01:12 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/expand.c,v 1.40 2005/08/08 09:57:29 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1427,7 +1427,10 @@
s = find_header(US"reply-to:", exists_only, newsize, FALSE,
headers_charset);
if (s == NULL || *s == 0)
+ {
+ *newsize = 0; /* For the *s==0 case */
s = find_header(US"from:", exists_only, newsize, FALSE, headers_charset);
+ }
return (s == NULL)? US"" : s;
/* A recipients list is available only during system message filtering,
Index: 082
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/confs/082,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 082 22 Jun 2005 10:17:23 -0000 1.2
+++ 082 8 Aug 2005 09:57:30 -0000 1.3
@@ -14,4 +14,15 @@
hostlist hlist = 10.11.12.13 : iplsearch;DIR/aux/082.iplsearch
headers_charset = iso-8859-8
+acl_smtp_rcpt = accept
+acl_smtp_data = check_data
+
+
+# ----- ACL -----
+
+begin acl
+
+check_data:
+ deny message = reply_address=<$reply_address>
+
# End of Exim 4 configuration
Index: 082
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/scripts/082,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- 082 22 Jun 2005 10:17:23 -0000 1.14
+++ 082 8 Aug 2005 09:57:30 -0000 1.15
@@ -658,3 +658,34 @@
-p received_protocol = $received_protocol
-p sender_host_name = $sender_host_name
****
+# Test $reply_address
+0
+exim -bh 10.0.0.0
+mail from:<>
+rcpt to:<some@body>
+data
+.
+mail from:<>
+rcpt to:<some@body>
+data
+From: a@b
+.
+mail from:<>
+rcpt to:<some@body>
+data
+From: a@b
+Reply-to: c@d
+.
+mail from:<>
+rcpt to:<some@body>
+data
+Reply-to:
+.
+mail from:<>
+rcpt to:<some@body>
+data
+Reply-to:
+From: x@y
+.
+quit
+****
Index: 082
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stderr/082,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 082 1 Aug 2005 13:20:29 -0000 1.2
+++ 082 8 Aug 2005 09:57:30 -0000 1.3
@@ -98,3 +98,45 @@
result: -oMt sender_ident = me
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
1999-03-02 09:44:33 no host name found for IP address 10.11.12.13
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> host in sender_unqualified_hosts? no (option unset)
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> using ACL "check_data"
+>>> processing "deny"
+>>> deny: condition test succeeded
+LOG: 10HmaX-0005vi-00 H=[10.0.0.0] F=<> rejected after DATA: reply_address=<>
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> host in ignore_fromline_hosts? no (option unset)
+>>> using ACL "check_data"
+>>> processing "deny"
+>>> deny: condition test succeeded
+LOG: 10HmaY-0005vi-00 H=[10.0.0.0] F=<> rejected after DATA: reply_address=<a@b>
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> host in ignore_fromline_hosts? no (option unset)
+>>> using ACL "check_data"
+>>> processing "deny"
+>>> deny: condition test succeeded
+LOG: 10HmaZ-0005vi-00 H=[10.0.0.0] F=<> rejected after DATA: reply_address=<c@d>
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> host in ignore_fromline_hosts? no (option unset)
+>>> using ACL "check_data"
+>>> processing "deny"
+>>> deny: condition test succeeded
+LOG: 10HmbA-0005vi-00 H=[10.0.0.0] F=<> rejected after DATA: reply_address=<>
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> host in ignore_fromline_hosts? no (option unset)
+>>> using ACL "check_data"
+>>> processing "deny"
+>>> deny: condition test succeeded
+LOG: 10HmbB-0005vi-00 H=[10.0.0.0] F=<> rejected after DATA: reply_address=<x@y>
Index: 082
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/082,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- 082 22 Jun 2005 10:17:23 -0000 1.15
+++ 082 8 Aug 2005 09:57:30 -0000 1.16
@@ -646,3 +646,30 @@
> -p received_protocol = special
> -p sender_host_name = host.name
>
+
+**** SMTP testing session as if from host 10.0.0.0
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550 reply_address=<>
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550 reply_address=<a@b>
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550 reply_address=<c@d>
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550 reply_address=<>
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550 reply_address=<x@y>
+221 myhost.test.ex closing connection