git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fd5ad03
)
avoid modifying possible config text during :fail: delivery
author
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 14 May 2021 23:01:27 +0000
(
00:01
+0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sun, 27 Jun 2021 23:30:02 +0000
(
00:30
+0100)
src/src/parse.c
patch
|
blob
|
history
diff --git
a/src/src/parse.c
b/src/src/parse.c
index 896d00f30bdfe41b74eb1df5f3d77f734e792030..0384977aa31f8c8cdba324ff0b0119d098e9a34d 100644
(file)
--- a/
src/src/parse.c
+++ b/
src/src/parse.c
@@
-1275,7
+1275,7
@@
for (;;)
syntax error has been skipped. I now think it is the wrong approach, but
have left this here just in case, and for the record. */
syntax error has been skipped. I now think it is the wrong approach, but
have left this here just in case, and for the record. */
-
#ifdef NEVER
+#ifdef NEVER
if (count > 0) return FF_DELIVERED; /* Something was generated */
if (syntax_errors == NULL || /* Not skipping syntax errors, or */
if (count > 0) return FF_DELIVERED; /* Something was generated */
if (syntax_errors == NULL || /* Not skipping syntax errors, or */
@@
-1285,8
+1285,7
@@
for (;;)
*error = string_sprintf("no addresses generated: syntax error in %s: %s",
(*syntax_errors)->text2, (*syntax_errors)->text1);
return FF_ERROR;
*error = string_sprintf("no addresses generated: syntax error in %s: %s",
(*syntax_errors)->text2, (*syntax_errors)->text1);
return FF_ERROR;
- #endif
-
+#endif
}
/* Find the end of the next address. Quoted strings in addresses may contain
}
/* Find the end of the next address. Quoted strings in addresses may contain
@@
-1323,13
+1322,7
@@
for (;;)
len = ss - s;
len = ss - s;
- DEBUG(D_route)
- {
- int save = s[len];
- s[len] = 0;
- debug_printf("extract item: %s\n", s);
- s[len] = save;
- }
+ DEBUG(D_route) debug_printf("extract item: %.*s\n", len, s);
/* Handle special addresses if permitted. If the address is :unknown:
ignore it - this is for backward compatibility with old alias files. You
/* Handle special addresses if permitted. If the address is :unknown:
ignore it - this is for backward compatibility with old alias files. You
@@
-1350,7
+1343,7
@@
for (;;)
else if (Ustrncmp(s, ":fail:", 6) == 0)
{ special = FF_FAIL; specopt = RDO_FAIL; } /* specbit is 0 */
else if (Ustrncmp(s, ":fail:", 6) == 0)
{ special = FF_FAIL; specopt = RDO_FAIL; } /* specbit is 0 */
- if (special
!= 0
)
+ if (special)
{
uschar *ss = Ustrchr(s+1, ':') + 1;
if ((options & specopt) == specbit)
{
uschar *ss = Ustrchr(s+1, ':') + 1;
if ((options & specopt) == specbit)
@@
-1358,10
+1351,9
@@
for (;;)
*error = string_sprintf("\"%.*s\" is not permitted", len, s);
return FF_ERROR;
}
*error = string_sprintf("\"%.*s\" is not permitted", len, s);
return FF_ERROR;
}
- while (*ss != 0 && isspace(*ss)) ss++;
- while (s[len] != 0 && s[len] != '\n') len++;
- s[len] = 0;
- *error = string_copy(ss);
+ while (*ss && isspace(*ss)) ss++;
+ while (s[len] && s[len] != '\n') len++;
+ *error = string_copyn(ss, s + len - ss);
return special;
}
return special;
}