diff options
author | René Scharfe <l.s.r@web.de> | 2017-02-25 20:21:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-27 11:20:17 -0800 |
commit | 50a01cc48c9a46fe75e4a014fb7847c2f4482406 (patch) | |
tree | 209769b8f8f12b5621d711fe212642c9e6eed549 /commit.c | |
parent | preparing for 2.10.3 (diff) | |
download | tgif-50a01cc48c9a46fe75e4a014fb7847c2f4482406.tar.xz |
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>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) || |