{"thread":{"id":"43745","subject":"[PATCH 1/3] shortlog: do not crash on parsing \"[PATCH\"","startedAt":"2006-11-19T16:28:25Z","lastAt":"2006-11-19T16:28:25Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"297684","messageId":"Pine.LNX.4.63.0611191727560.13772@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43745","inReplyTo":null,"subject":"[PATCH 1/3] shortlog: do not crash on parsing \"[PATCH\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-19T16:28:25Z","receivedAt":"2006-11-19T16:28:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nAnnoyingly, it looked for the closing bracket in the author name\ninstead of in the message, and then accessed the NULL pointer.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n builtin-shortlog.c |   16 +++++++++-------\n 1 files changed, 9 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex 48a2a0b..26212b0 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -108,13 +108,15 @@ static void insert_author_oneline(struct\n \t\tfree(buffer);\n \n \tif (!strncmp(oneline, \"[PATCH\", 6)) {\n-\t\tchar *eob = strchr(buffer, ']');\n-\n-\t\twhile (isspace(eob[1]) && eob[1] != '\\n')\n-\t\t\teob++;\n-\t\tif (eob - oneline < onelinelen) {\n-\t\t\tonelinelen -= eob - oneline;\n-\t\t\toneline = eob;\n+\t\tchar *eob = strchr(oneline, ']');\n+\n+\t\tif (eob) {\n+\t\t\twhile (isspace(eob[1]) && eob[1] != '\\n')\n+\t\t\t\teob++;\n+\t\t\tif (eob - oneline < onelinelen) {\n+\t\t\t\tonelinelen -= eob - oneline;\n+\t\t\t\toneline = eob;\n+\t\t\t}\n \t\t}\n \t}\n \n-- \n1.4.4.GIT\n"}]}