mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
fmt-merge-msg: fix off-by-one bug
Thanks to the recent malloc()->xmalloc() change, and XMALLOC_POISON, this bug was found. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
8c02eee29e
commit
af04b12710
@ -142,7 +142,7 @@ static int handle_line(char *line)
|
||||
if (origin[0] == '\'' && origin[len - 1] == '\'') {
|
||||
char *new_origin = xmalloc(len - 1);
|
||||
memcpy(new_origin, origin + 1, len - 2);
|
||||
new_origin[len - 1] = 0;
|
||||
new_origin[len - 2] = 0;
|
||||
origin = new_origin;
|
||||
} else
|
||||
origin = strdup(origin);
|
||||
|
Loading…
Reference in New Issue
Block a user