Skip to content

Commit 270623e

Browse files
committed
fixing sigsev in replacedomain when freeing input
1 parent 25ca03b commit 270623e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/string.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,14 +1486,15 @@ char *spamify_replacedomain(char *input, char *antispamdomain)
14861486
int domainlen = strlen(antispamdomain);
14871487
struct Push buff;
14881488
int in_ascii = TRUE, esclen = 0;
1489-
1489+
char *cursor;
1490+
14901491
INIT_PUSH(buff);
14911492

1492-
for (; *input; input++) {
1493+
for (cursor = input; *cursor; cursor++) {
14931494
if (set_iso2022jp) {
1494-
iso2022_state(input, &in_ascii, &esclen);
1495+
iso2022_state(cursor, &in_ascii, &esclen);
14951496
}
1496-
if (in_ascii == TRUE && *input == '@') {
1497+
if (in_ascii == TRUE && *cursor == '@') {
14971498
PushString(&buff, set_antispam_at);
14981499
if (domainlen > 0) {
14991500
/* append the new domain */
@@ -1502,7 +1503,7 @@ char *spamify_replacedomain(char *input, char *antispamdomain)
15021503
}
15031504
}
15041505
else {
1505-
PushByte(&buff, *input);
1506+
PushByte(&buff, *cursor);
15061507
}
15071508
}
15081509
free(input);

0 commit comments

Comments
 (0)