DKIM: fix crash with a verification when dkim disabled, under CHUNKING
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 12 Feb 2017 16:44:09 +0000 (16:44 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 12 Feb 2017 16:44:09 +0000 (16:44 +0000)
src/src/smtp_in.c

index 6963e7da2286cbf8d280e15fbe9f6ce0b8b31596..db684a6467a01d44f8f1c7f36738c8015b6b5991 100644 (file)
@@ -486,12 +486,17 @@ uschar * log_msg;
 
 for(;;)
   {
+#ifndef DISABLE_DKIM
+  BOOL dkim_save;
+#endif
+
   if (chunking_data_left > 0)
     return lwr_receive_getc(chunking_data_left--);
 
   receive_getc = lwr_receive_getc;
   receive_ungetc = lwr_receive_ungetc;
 #ifndef DISABLE_DKIM
+  dkim_save = dkim_collect_input;
   dkim_collect_input = FALSE;
 #endif
 
@@ -592,7 +597,7 @@ next_cmd:
       receive_getc = bdat_getc;
       receive_ungetc = bdat_ungetc;
 #ifndef DISABLE_DKIM
-      dkim_collect_input = TRUE;
+      dkim_collect_input = dkim_save;
 #endif
       break;   /* to top of main loop */
       }