1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

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:
René Scharfe 2017-02-25 20:21:52 +01:00 committed by Junio C Hamano
parent c3808ca698
commit 50a01cc48c

View file

@ -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) ||