Ensure output buffer big enough for DSN additions to MAIL FROM. Bug 1482
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 26 May 2014 15:07:33 +0000 (16:07 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 4 Jun 2014 15:25:40 +0000 (16:25 +0100)
src/src/smtp_out.c
src/src/transports/smtp.c

index 0fa4ccd4846c8ee722b39822cbdded3f6eeaf215..b6ff5110815ffa67b26855d790bc0e649c355a29 100644 (file)
@@ -352,6 +352,10 @@ if (!string_vformat(big_buffer, big_buffer_size, CS format, ap))
 va_end(ap);
 count = Ustrlen(big_buffer);
 
 va_end(ap);
 count = Ustrlen(big_buffer);
 
+if (count > outblock->buffersize)
+  log_write(0, LOG_MAIN|LOG_PANIC_DIE, "overlong write_command in outgoing "
+    "SMTP");
+
 if (count > outblock->buffersize - (outblock->ptr - outblock->buffer))
   {
   rc = outblock->cmd_count;                 /* flush resets */
 if (count > outblock->buffersize - (outblock->ptr - outblock->buffer))
   {
   rc = outblock->cmd_count;                 /* flush resets */
index 33c91a67ab055d28098580c46ad83c38cb455aa4..40eebe8b68c9bad080dff10f6e54322dfb12cd67 100644 (file)
@@ -1228,7 +1228,7 @@ uschar new_message_id[MESSAGE_ID_LENGTH + 1];
 uschar *p;
 uschar buffer[4096];
 uschar inbuffer[4096];
 uschar *p;
 uschar buffer[4096];
 uschar inbuffer[4096];
-uschar outbuffer[1024];
+uschar outbuffer[4096];
 
 suppress_tls = suppress_tls;  /* stop compiler warning when no TLS support */
 
 
 suppress_tls = suppress_tls;  /* stop compiler warning when no TLS support */