login
Header Space

 
 

[PATCH] Remove possible segfault in http-fetch.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Florian Weimer <fw@...>
Cc: <git@...>
Date: Saturday, May 20, 2006 - 6:46 pm

Free the curl string lists after running http_cleanup to
avoid an occasional segfault in the curl library.  Seems
to only occur if the website returns a 405 error.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
---

On Sat, 20 May 2006 20:47:54 +0200
Florian Weimer <fw@deneb.enyo.de> wrote:


Florian, could you please test this patch.

It comes with a big disclaimer because I don't really know the
code in here all that well.  However gdb reports the segfault
happens in a strncasecmp call, and seeing as we've released a
bunch of strings prior to the call....

Testing seems to confirm that the segfault is removed by this patch.

As to why the website returns a 405 error in the first place is still
a mystery to me.

Sean


 http-fetch.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/http-fetch.c b/http-fetch.c
index 861644b..178f1ee 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -1269,10 +1269,10 @@ int main(int argc, char **argv)
 	if (pull(commit_id))
 		rc = 1;
 
-	curl_slist_free_all(no_pragma_header);
-
 	http_cleanup();
 
+	curl_slist_free_all(no_pragma_header);
+
 	if (corrupt_object_found) {
 		fprintf(stderr,
 "Some loose object were found to be corrupt, but they might be just\n"
-- 
1.3.GIT

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Segfaults with USE_CURL_MULTI, Florian Weimer, (Sat May 20, 2:47 pm)
Re: Segfaults with USE_CURL_MULTI, Pavel Roskin, (Mon May 22, 11:56 am)
[PATCH] Remove possible segfault in http-fetch., Sean, (Sat May 20, 6:46 pm)
Re: [PATCH] Remove possible segfault in http-fetch., Junio C Hamano, (Sun May 21, 3:49 am)
Re: [PATCH] Remove possible segfault in http-fetch., Nick Hengeveld, (Wed May 31, 12:07 pm)
Re: [PATCH] Remove possible segfault in http-fetch., Florian Weimer, (Sat May 20, 7:00 pm)
speck-geostationary