commit: be more precise when searching for headers
[gitweb.git] / commit.c
index aada266f9a85e379ab2d2603b82071be4bb19ded..ee49c1ce25f57f5c2af34832ee80f6e7d4f2a0c8 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1354,8 +1354,8 @@ static struct commit_extra_header *read_commit_extra_header_lines(
                strbuf_reset(&buf);
                it = NULL;
 
-               eof = strchr(line, ' ');
-               if (next <= eof)
+               eof = memchr(line, ' ', next - line);
+               if (!eof)
                        eof = next;
 
                if (standard_header_field(line, eof - line) ||