@matheusbsbs / matheus-bagliano / commits / af04b12710
Fork 0

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>

Johannes Schindelin committed Sep 1, 2006 at 10:49 UTC af04b1271090801b277938836dcb7a39fc059721
1 file changed +1 -1
builtin-fmt-merge-msg.c
+1 -1
@@ -142,7 +142,7 @@ static int handle_line(char *line)
142 if (origin[0] == '\'' && origin[len - 1] == '\'') {
143 char *new_origin = xmalloc(len - 1);
144 memcpy(new_origin, origin + 1, len - 2);
145 - new_origin[len - 1] = 0;
145 + new_origin[len - 2] = 0;
146 origin = new_origin;
147 } else
148 origin = strdup(origin);