GNOME Bugzilla – Bug 310105
segfault in nanohttp.c
Last modified: 2009-08-15 18:40:50 UTC
Run 'make check' and inspect the output (make ends with rc=0!) A double-free bug in nanohttp.c may cause a segfault and indeed does so during 'make check': testapi.c -> test_nanohttp() -> test_xmlNanoHTTPScanProxy() Here a small patch fixing this: diff -ur -N libxml2-2.6.20.orig/nanohttp.c libxml2-2.6.20/nanohttp.c --- libxml2-2.6.20.orig/nanohttp.c 2005-04-28 11:11:05.000000000 +0200 +++ libxml2-2.6.20/nanohttp.c 2005-07-12 00:05:14.000000000 +0200 @@ -248,8 +248,10 @@ void xmlNanoHTTPCleanup(void) { - if (proxy != NULL) + if (proxy != NULL) { xmlFree(proxy); + proxy = NULL; + } #ifdef _WINSOCKAPI_ if (initialized) WSACleanup();
The change makes sense, but I can't reproduce the crash, though I have run testapi a number of times before the release on i386, x86_64 and valgrind ... Anyway, applied, I will commit soon. Daniel
Hi Daniel, the reason that you couldn't reproduce the segfault from testapi might be that we have http_proxy in the environment whereas you probably don't. Peter
Ha ha ! Yes this makes far more sense now ! One more reason why regression tests really need to be run as much as possible ! Fix commited to CVS, thanks, Daniel
This should be closed by release of libxml2-2.6.21, thanks, Daniel