{"thread":{"id":"5449","subject":"[PATCH] fmt-merge-msg: fix off-by-one bug","startedAt":"2006-09-01T08:49:29Z","lastAt":"2006-09-01T08:49:29Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"26181","messageId":"Pine.LNX.4.63.0609011048590.28360@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5449","inReplyTo":null,"subject":"[PATCH] fmt-merge-msg: fix off-by-one bug","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-09-01T08:49:29Z","receivedAt":"2006-09-01T08:49:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThanks to the recent malloc()->xmalloc() change, and XMALLOC_POISON, this bug\nwas found.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n builtin-fmt-merge-msg.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c\nindex ed59e77..432963d 100644\n--- a/builtin-fmt-merge-msg.c\n+++ b/builtin-fmt-merge-msg.c\n@@ -142,7 +142,7 @@ static int handle_line(char *line)\n \t\tif (origin[0] == '\\'' && origin[len - 1] == '\\'') {\n \t\t\tchar *new_origin = xmalloc(len - 1);\n \t\t\tmemcpy(new_origin, origin + 1, len - 2);\n-\t\t\tnew_origin[len - 1] = 0;\n+\t\t\tnew_origin[len - 2] = 0;\n \t\t\torigin = new_origin;\n \t\t} else\n \t\t\torigin = strdup(origin);\n-- \n1.4.2.gc2fc-dirty\n"}]}