Merge branch 'rs/mailinfo-header-cmp' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 25 Jun 2014 18:48:23 +0000 (11:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Jun 2014 18:48:23 +0000 (11:48 -0700)
"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

1  2 
builtin/mailinfo.c
index 2c3cd8eab7073669001ad605020577279ba7a07d,6b44156264d246e363dd187666f142c7658c40b0..cf11c8d6071dd791508d3bd5f46d30550765a90f
@@@ -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;