Merge branch 'maint'
* maint: Small correction in reading of commit headers Documentation: fix typo in git-remote.txt Add test for blame corner cases. blame: -C -C -C blame: Notice a wholesale incorporation of an existing file. Fix --boundary output diff format documentation: describe raw combined diff format Mention version 1.5.1 in tutorial and user-manual Add --no-rebase option to git-svn dcommit Fix markup in git-svn man page
This commit is contained in:
4
commit.c
4
commit.c
@ -638,7 +638,9 @@ static char *get_header(const struct commit *commit, const char *key)
|
||||
next = NULL;
|
||||
} else
|
||||
next = eol + 1;
|
||||
if (!strncmp(line, key, key_len) && line[key_len] == ' ') {
|
||||
if (eol - line > key_len &&
|
||||
!strncmp(line, key, key_len) &&
|
||||
line[key_len] == ' ') {
|
||||
int len = eol - line - key_len;
|
||||
char *ret = xmalloc(len);
|
||||
memcpy(ret, line + key_len + 1, len - 1);
|
||||
|
||||
Reference in New Issue
Block a user