CHUNKING: Fix flush of chunk on error
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 21 Oct 2017 18:27:01 +0000 (19:27 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 21 Oct 2017 18:27:01 +0000 (19:27 +0100)
doc/doc-txt/ChangeLog
src/src/smtp_in.c

index 9404b7a578b42e4092aadcfac445470963fb69e1..4b3d64e0cbed168d1424c5b98d3f6630c2089356 100644 (file)
@@ -178,6 +178,10 @@ JH/30 Fix a logging bug on aarch64: an unsafe routine was previously used for
       connection in response to HELO" was logged instead of the actual 4xx
       error for the HELO.
 
       connection in response to HELO" was logged instead of the actual 4xx
       error for the HELO.
 
+JH/31 Fix CHUNKING code to properly flush the unwanted chunk after an error.
+      Previously only that bufferd was discarded, resulting in SYMTP command
+      desynchronisation.
+
 
 Exim version 4.89
 -----------------
 
 Exim version 4.89
 -----------------
index b27949e35c047437e0c0d9ea03a34768250aa0a1..1fdb705a5f86cd4e5e140a3fd792aac992cc4ca9 100644 (file)
@@ -681,8 +681,11 @@ return buf;
 void
 bdat_flush_data(void)
 {
 void
 bdat_flush_data(void)
 {
-unsigned n = chunking_data_left;
-(void) bdat_getbuf(&n);
+while (chunking_data_left)
+{
+  unsigned n = chunking_data_left;
+  (void) bdat_getbuf(&n);
+}
 
 receive_getc = lwr_receive_getc;
 receive_getbuf = lwr_receive_getbuf;
 
 receive_getc = lwr_receive_getc;
 receive_getbuf = lwr_receive_getbuf;