{"thread":{"id":"21370","subject":"[PATCH] Prevent git-remote-cvs from segfaulting","startedAt":"2009-10-27T01:43:36Z","lastAt":"2009-10-27T01:43:36Z","messageCount":1,"participants":["Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"125982","messageId":"1256607816-10509-1-git-send-email-srabbelier@gmail.com","threadId":"21370","inReplyTo":null,"subject":"[PATCH] Prevent git-remote-cvs from segfaulting","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-10-27T01:43:36Z","receivedAt":"2009-10-27T01:43:36Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"In [0] Shawn identified what caused git-remote-cvs from segfaulting,\nwhich should be fixed as desribed in Daniel's reply to that [1].\nIn the meanwhile, the current patch fixes the issue until Daniel\nsubmits a patch to fix it properly.\n\n[0] http://thread.gmane.org/gmane.comp.version-control.git/130357/focus=130421\n[1] http://thread.gmane.org/gmane.comp.version-control.git/130357/focus=131021\n\nSigned-off-by: Sverre Rabbelier <srabbelier@gmail.com>\nNot-Signed-off-by: Jeff King <peff@peff.net>\n---\n\n\tJeff wrote this total hack but wants no credit, responsibility or\n\tanything else to do with it whatsoever.\n\n\tI think it might be nice to have this on top of pu until Daniel\n\tsubmits a proper patch, so that until that time the test suite\n\tdoes not segfault.\n\n transport-helper.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 410aa49..d867abb 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -68,6 +68,8 @@ static struct child_process *get_helper(struct transport *transport)\n static int disconnect_helper(struct transport *transport)\n {\n \tstruct helper_data *data = transport->data;\n+\tif(!data)\n+\t\treturn 0;\n \tif (data->helper) {\n \t\twrite_str_in_full(data->helper->in, \"\\n\");\n \t\tclose(data->helper->in);\n@@ -78,6 +80,7 @@ static int disconnect_helper(struct transport *transport)\n \t\tfree(data->helper);\n \t\tdata->helper = NULL;\n \t}\n+\ttransport->data = NULL;\n \tfree(data);\n \treturn 0;\n }\n-- \n1.6.5.1.125.g76b2.dirty\n"}]}