Avoid leaving $domain live with bogus info, during server connection startup
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 23 Nov 2018 23:55:36 +0000 (23:55 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 24 Nov 2018 00:52:14 +0000 (00:52 +0000)
Recent efforts to reduce string-copy ops while also avoiding using excessive memory
tripped a check on freeing the still-live variable.  It is unclear why the variable
was set anyway, even though commented.  The use was introduced between Exim 3.36 and 4.0

src/src/smtp_in.c

index e9e81779874076cace315dc20868920d36dd7233..af2cdb285f3e43655ecd894ca854ad6e47742a49 100644 (file)
@@ -4169,9 +4169,8 @@ while (done <= 0)
        because otherwise the log can be confusing. */
 
        if (  !sender_host_name
-          && (deliver_domain = sender_helo_name,  /* set $domain */
-              match_isinlist(sender_helo_name, CUSS &helo_lookup_domains, 0,
-               &domainlist_anchor, NULL, MCL_DOMAIN, TRUE, NULL)) == OK)
+          && match_isinlist(sender_helo_name, CUSS &helo_lookup_domains, 0,
+               &domainlist_anchor, NULL, MCL_DOMAIN, TRUE, NULL) == OK)
          (void)host_name_lookup();
 
        /* Rebuild the fullhost info to include the HELO name (and the real name