From: Junio C Hamano Date: Wed, 25 Jun 2014 18:48:23 +0000 (-0700) Subject: Merge branch 'rs/mailinfo-header-cmp' into maint X-Git-Tag: v2.0.1~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed5d0d2105c84ec40dd7526c9cd20e4587c62987;p=git Merge branch 'rs/mailinfo-header-cmp' into maint "git mailinfo" used to read beyond 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 --- ed5d0d2105c84ec40dd7526c9cd20e4587c62987 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;