From: Junio C Hamano Date: Mon, 9 Jun 2014 18:27:53 +0000 (-0700) Subject: Merge branch 'rs/mailinfo-header-cmp' X-Git-Tag: v2.1.0-rc0~140 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d37e8c54a60c4aa92e1bb412b416ca1fea821587 Merge branch 'rs/mailinfo-header-cmp' Avoid running over the end of header string while parsing an incoming e-mail message to extract the patch. * rs/mailinfo-header-cmp: mailinfo: use strcmp() for string comparison --- d37e8c54a60c4aa92e1bb412b416ca1fea821587 diff --cc builtin/mailinfo.c index 2c3cd8eab7,6b44156264..cf11c8d607 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@@ -332,9 -332,9 +332,9 @@@ static int check_header(const struct st ret = 1; /* Should this return 0? */ goto check_header_out; } - if (!prefixcmp(line->buf, "[PATCH]") && isspace(line->buf[7])) { + if (starts_with(line->buf, "[PATCH]") && isspace(line->buf[7])) { for (i = 0; header[i]; i++) { - if (!memcmp("Subject", header[i], 7)) { + if (!strcmp("Subject", header[i])) { handle_header(&hdr_data[i], line); ret = 1; goto check_header_out;