git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Prevent git-remote-cvs from segfaulting

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Oct 27, 2009, 01:43 UTC
Message-ID
<1256607816-10509-1-git-send-email-srabbelier@gmail.com>

In [0] Shawn identified what caused git-remote-cvs from segfaulting, which should be fixed as desribed in Daniel's reply to that [1]. In the meanwhile, the current patch fixes the issue until Daniel submits a patch to fix it properly.

[0] http://thread.gmane.org/gmane.comp.version-control.git/130357/focus=130421 [1] http://thread.gmane.org/gmane.comp.version-control.git/130357/focus=131021

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Not-Signed-off-by: Jeff King <peff@peff.net>
---
	Jeff wrote this total hack but wants no credit, responsibility or
	anything else to do with it whatsoever.
	I think it might be nice to have this on top of pu until Daniel
	submits a proper patch, so that until that time the test suite
	does not segfault.
 transport-helper.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 410aa49..d867abb 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -68,6 +68,8 @@ static struct child_process *get_helper(struct transport *transport)
 static int disconnect_helper(struct transport *transport)
 {
 	struct helper_data *data = transport->data;
+	if(!data)
+		return 0;
 	if (data->helper) {
 		write_str_in_full(data->helper->in, "\n");
 		close(data->helper->in);
@@ -78,6 +80,7 @@ static int disconnect_helper(struct transport *transport)
 		free(data->helper);
 		data->helper = NULL;
 	}
+	transport->data = NULL;
 	free(data);
 	return 0;
 }
-- 
1.6.5.1.125.g76b2.dirty
Message 1 of 1 in “Prevent git-remote-cvs from segfaulting”
  1. Prevent git-remote-cvs from segfaultingSverre Rabbelier, Oct 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.