projects
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check syscall return values.
[exim.git]
/
src
/
src
/
spool_mbox.c
diff --git
a/src/src/spool_mbox.c
b/src/src/spool_mbox.c
index 635fb8df1c4085150f7d5b51f0d55920154b3e60..12cf3d43eaf58b7c33ed96575cad8403b1979ef5 100644
(file)
--- a/
src/src/spool_mbox.c
+++ b/
src/src/spool_mbox.c
@@
-56,7
+56,7
@@
FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) {
mbox_file = modefopen(mbox_path, "wb", SPOOL_MODE);
if (mbox_file == NULL) {
log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno,
mbox_file = modefopen(mbox_path, "wb", SPOOL_MODE);
if (mbox_file == NULL) {
log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno,
- "scan file %s", mbox_
file
));
+ "scan file %s", mbox_
path
));
goto OUT;
};
goto OUT;
};
@@
-96,7
+96,11
@@
FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) {
};
/* End headers */
};
/* 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) {
/* copy body file */
if (source_file_override == NULL) {
@@
-155,7
+159,7
@@
FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) {
if (Ustat(mbox_path, &statbuf) != 0 ||
(yield = Ufopen(mbox_path,"rb")) == NULL) {
log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno,
if (Ustat(mbox_path, &statbuf) != 0 ||
(yield = Ufopen(mbox_path,"rb")) == NULL) {
log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno,
- "scan file %s", mbox_
file
));
+ "scan file %s", mbox_
path
));
goto OUT;
};
goto OUT;
};