git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reduce number of places knowing about filename-construction for mbox file-for-scanning
[exim.git]
/
src
/
src
/
regex.c
diff --git
a/src/src/regex.c
b/src/src/regex.c
index 3852ad8c52a68427651bd4b9708cb54b03aab6ff..3560bef529a813158ab690991fd650832da394de 100644
(file)
--- a/
src/src/regex.c
+++ b/
src/src/regex.c
@@
-2,8
+2,10
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2003-2015 */
-/* License: GPL */
+/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2003-2015
+ * License: GPL
+ * Copyright (c) The Exim Maintainers 2016
+ */
/* Code for matching regular expressions against headers and body.
Called from acl.c. */
/* Code for matching regular expressions against headers and body.
Called from acl.c. */
@@
-103,7
+105,7
@@
regex_match_string = NULL;
if (!mime_stream) /* We are in the DATA ACL */
{
if (!mime_stream) /* We are in the DATA ACL */
{
- if (!(mbox_file = spool_mbox(&mbox_size, NULL)))
+ if (!(mbox_file = spool_mbox(&mbox_size, NULL
, NULL
)))
{ /* error while spooling */
log_write(0, LOG_MAIN|LOG_PANIC,
"regex acl condition: error while creating mbox spool file");
{ /* error while spooling */
log_write(0, LOG_MAIN|LOG_PANIC,
"regex acl condition: error while creating mbox spool file");
@@
-112,7
+114,12
@@
if (!mime_stream) /* We are in the DATA ACL */
}
else
{
}
else
{
- f_pos = ftell(mime_stream);
+ if ((f_pos = ftell(mime_stream)) < 0)
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "regex acl condition: mime_stream: %s", strerror(errno));
+ return DEFER;
+ }
mbox_file = mime_stream;
}
mbox_file = mime_stream;
}
@@
-141,7
+148,12
@@
if (!mime_stream)
else
{
clearerr(mime_stream);
else
{
clearerr(mime_stream);
- fseek(mime_stream, f_pos, SEEK_SET);
+ if (fseek(mime_stream, f_pos, SEEK_SET) == -1)
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "regex acl condition: mime_stream: %s", strerror(errno));
+ clearerr(mime_stream);
+ }
}
return ret;
}
return ret;