[exim-cvs] Fix variable initialisation in smtp transport. B…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List via exim-cvs
Date:  
To: exim-cvs
CC: Exim Git Commits Mailing List
Subject: [exim-cvs] Fix variable initialisation in smtp transport. Bug 2996
Gitweb: https://git.exim.org/exim.git/commitdiff/a8786a66feb3c003c74551399b345b1634cc6739
Commit:     a8786a66feb3c003c74551399b345b1634cc6739
Parent:     7533e17a427d6ae51bba9af028b0d9496f487caf
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu May 4 15:41:46 2023 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu May 4 19:46:02 2023 +0100


    Fix variable initialisation in smtp transport.  Bug 2996
---
 doc/doc-txt/ChangeLog     | 8 ++++++++
 src/src/transports/smtp.c | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index d29ba6f65..09b4d3a60 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -125,6 +125,14 @@ JH/26 For a ${readsocket } in TLS mode, send a TLS Close Alert before the TCP
 JH/27 Fix ${srs_encode ..}.  Previously it would give a bad result for one day
       every 1024 days.


+JH/28 Bug 2996: Fix a crash in the smtp transport.  When finding that the
+      message being considered for delivery was already being handled by
+      another process, and having an SMTP connection already open, the function
+      to close it tried to use an uninitialized variable.  This would afftect
+      high-volume sites more, especially when running mailing-list-style loads.
+      Pollution of logs was the major effect, as the other process delivered
+      the message.  Found and partly investigated by Graeme Fowler.
+


Exim version 4.96
-----------------
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index c5951832b..c72028ce9 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -4973,7 +4973,7 @@ smtp_transport_closedown(transport_instance *tblock)
{
smtp_transport_options_block * ob = SOB tblock->options_block;
client_conn_ctx cctx;
-smtp_context sx;
+smtp_context sx = {0};
uschar buffer[256];
uschar inbuffer[4096];
uschar outbuffer[16];

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/