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
Avoid crash with badly-terminated non-recognised mime parameter
[exim.git]
/
src
/
src
/
exim.c
diff --git
a/src/src/exim.c
b/src/src/exim.c
index 102d8504ca3df52ccf2539b8a03ab28e543d325e..d6915d4ad209afb1c050eca4f92b7fc10c20711b 100644
(file)
--- a/
src/src/exim.c
+++ b/
src/src/exim.c
@@
-131,10
+131,11
@@
Returns: TRUE or FALSE
*/
BOOL
*/
BOOL
-regex_match_and_setup(const pcre *re, uschar *subject, int options, int setup)
+regex_match_and_setup(const pcre *re,
const
uschar *subject, int options, int setup)
{
int ovector[3*(EXPAND_MAXN+1)];
{
int ovector[3*(EXPAND_MAXN+1)];
-int n = pcre_exec(re, NULL, CS subject, Ustrlen(subject), 0,
+uschar * s = string_copy(subject); /* de-constifying */
+int n = pcre_exec(re, NULL, CS s, Ustrlen(s), 0,
PCRE_EOPT | options, ovector, sizeof(ovector)/sizeof(int));
BOOL yield = n >= 0;
if (n == 0) n = EXPAND_MAXN + 1;
PCRE_EOPT | options, ovector, sizeof(ovector)/sizeof(int));
BOOL yield = n >= 0;
if (n == 0) n = EXPAND_MAXN + 1;
@@
-144,7
+145,7
@@
if (yield)
expand_nmax = (setup < 0)? 0 : setup + 1;
for (nn = (setup < 0)? 0 : 2; nn < n*2; nn += 2)
{
expand_nmax = (setup < 0)? 0 : setup + 1;
for (nn = (setup < 0)? 0 : 2; nn < n*2; nn += 2)
{
- expand_nstring[expand_nmax] = s
ubject
+ ovector[nn];
+ expand_nstring[expand_nmax] = s + ovector[nn];
expand_nlength[expand_nmax++] = ovector[nn+1] - ovector[nn];
}
expand_nmax--;
expand_nlength[expand_nmax++] = ovector[nn+1] - ovector[nn];
}
expand_nmax--;
@@
-412,11
+413,11
@@
if (exim_tvcmp(&now_tv, then_tv) <= 0)
{
if (!running_in_test_harness)
{
{
if (!running_in_test_harness)
{
- debug_printf("tick check:
%lu.%06lu %lu
.%06lu\n",
+ debug_printf("tick check:
" TIME_T_FMT ".%06lu " TIME_T_FMT "
.%06lu\n",
then_tv->tv_sec, (long) then_tv->tv_usec,
now_tv.tv_sec, (long) now_tv.tv_usec);
then_tv->tv_sec, (long) then_tv->tv_usec,
now_tv.tv_sec, (long) now_tv.tv_usec);
- debug_printf("waiting
%lu.%06lu\n", itval.it_value.tv_sec
,
- (long) itval.it_value.tv_usec);
+ debug_printf("waiting
" TIME_T_FMT ".%06lu\n"
,
+
itval.it_value.tv_sec,
(long) itval.it_value.tv_usec);
}
}
}
}
@@
-2683,7
+2684,7
@@
for (i = 1; i < argc; i++)
#ifdef EXPERIMENTAL_DSN
/* -MCD: set the smtp_use_dsn flag; this indicates that the host
that exim is connected to supports the esmtp extension DSN */
#ifdef EXPERIMENTAL_DSN
/* -MCD: set the smtp_use_dsn flag; this indicates that the host
that exim is connected to supports the esmtp extension DSN */
- else if (strcmp(argrest, "CD") == 0)
+ else if (
U
strcmp(argrest, "CD") == 0)
{
smtp_use_dsn = TRUE;
break;
{
smtp_use_dsn = TRUE;
break;