X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/3ecab1575ef1f45a5e7cd3c48cd937ffa8eb0ad9..0f0c8159c43045f4ad847a0129dca7eddd313285:/src/src/spool_mbox.c diff --git a/src/src/spool_mbox.c b/src/src/spool_mbox.c index bdeb2b1a6..edc28034c 100644 --- a/src/src/spool_mbox.c +++ b/src/src/spool_mbox.c @@ -26,7 +26,9 @@ uschar spooled_message_id[17]; /* returns a pointer to the FILE, and puts the size in bytes into mbox_file_size * normally, source_file_override is NULL */ -FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) { +FILE * +spool_mbox(unsigned long *mbox_file_size, const uschar *source_file_override) +{ uschar message_subdir[2]; uschar buffer[16384]; uschar *temp_string; @@ -96,7 +98,11 @@ FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) { }; /* End headers */ - (void)fwrite("\n", 1, 1, mbox_file); + if (fwrite("\n", 1, 1, mbox_file) != 1) { + log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \ + message headers to %s", mbox_path); + goto OUT; + } /* copy body file */ if (source_file_override == NULL) {