summaryrefslogtreecommitdiffstats
path: root/debian/patches/75_70-Fix-variable-initialisation-in-smtp-transport.-Bug-2.patch
blob: 4a2e3b54b746c138222d15b6576b35a76faf91bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From a8786a66feb3c003c74551399b345b1634cc6739 Mon Sep 17 00:00:00 2001
From: Jeremy Harris <jgh146exb@wizmail.org>
Date: Thu, 4 May 2023 15:41:46 +0100
Subject: [PATCH 1/3] Fix variable initialisation in smtp transport.  Bug 2996

---
 doc/ChangeLog     | 8 ++++++++
 src/transports/smtp.c | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -61,10 +61,18 @@ JH/23 Fix crash in string expansions. Pr
       was done, killing the process.
 
 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
 -----------------
 
 JH/01 Move the wait-for-next-tick (needed for unique message IDs) from
--- a/src/transports/smtp.c
+++ b/src/transports/smtp.c
@@ -4950,11 +4950,11 @@ Returns:    nothing
 void
 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];
 
 /*XXX really we need an active-smtp-client ctx, rather than assuming stdout */