Skip to contentSkip to conversation

Prevent git-remote-cvs from segfaulting

PATCH New Sverre Rabbelier 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Prevent git-remote-cvs from segfaulting

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

---

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(-)
transport-helper.c +3 -0
index 410aa49..d867abb 100644
@@ -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;
 }
Signature · 1 line
1.6.5.1.125.g76b2.dirty