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:
parent
c3808ca698
commit
50a01cc48c
1 changed files with 2 additions and 2 deletions
4
commit.c
4
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) ||
|
||||
|
|
Loading…
Reference in a new issue