commit: be more precise when searching for headers
Search for a space character only within the current line in read_commit_extra_header_lines() instead of searching in the whole buffer (and possibly beyond, if it's not NUL-terminated) and then discarding any results after the end of the current line. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c3808ca698
commit
50a01cc48c
4
commit.c
4
commit.c
@ -1354,8 +1354,8 @@ static struct commit_extra_header *read_commit_extra_header_lines(
|
|||||||
strbuf_reset(&buf);
|
strbuf_reset(&buf);
|
||||||
it = NULL;
|
it = NULL;
|
||||||
|
|
||||||
eof = strchr(line, ' ');
|
eof = memchr(line, ' ', next - line);
|
||||||
if (next <= eof)
|
if (!eof)
|
||||||
eof = next;
|
eof = next;
|
||||||
|
|
||||||
if (standard_header_field(line, eof - line) ||
|
if (standard_header_field(line, eof - line) ||
|
||||||
|
Reference in New Issue
Block a user