aboutsummaryrefslogtreecommitdiff
path: root/mailutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-22 15:53:16 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-22 15:53:16 +0200
commit3505e38bd1e5714fa1203e6752c573861aab8521 (patch)
tree6c77967c5594bed998a9781306719b49402ae9bc /mailutils
parente837a0dbbebf4229306df98fe9ee3b9bb30630c4 (diff)
downloadbusybox-3505e38bd1e5714fa1203e6752c573861aab8521.tar.gz
sendmail: fix segfault if "To: email1,email2" is used
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'mailutils')
-rw-r--r--mailutils/sendmail.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mailutils/sendmail.c b/mailutils/sendmail.c
index f440e6319..defbd9552 100644
--- a/mailutils/sendmail.c
+++ b/mailutils/sendmail.c
@@ -189,8 +189,9 @@ static void rcptto(const char *s)
// send to a list of comma separated addresses
static void rcptto_list(const char *list)
{
- char *str = xstrdup(list);
- char *s = str;
+ char *free_me = xstrdup(list);
+ char *str = free_me;
+ char *s = free_me;
char prev = 0;
int in_quote = 0;
@@ -208,7 +209,7 @@ static void rcptto_list(const char *list)
}
if (prev != ',')
rcptto(angle_address(str));
- free(str);
+ free(free_me);
}
int sendmail_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;