Date: Wed, 27 Jun 2012 21:43:20 +0100
I've attached a patch for potential inclusion into curl. The patch modifies
how slist_append handles the situation where a NULL char* is passed in,
currently this causes a segfault. While I agree people shouldn't be passing
a NULL value in I have fixed that issue in the app I discovered this in so
it can't happen I do think that modifying curl so it doesn't segfault would
be an improvement.
The way I have chosen to fix this in curl is to allow append to return the
original list is the data to be added is NULL, this both prevents a
segfault and also prevents data loss(and potential memory leak) that would
be caused by returning NULL.
Any comments on validity/changes welcome.
I have also attached a patch that updates the man page in the event the
first patch is included and a mini c app that replicates the segfault on
current curl builds and demonstrates the fix functions correctly on
-- ------------------------------ Rob Ward www.rob-ward.co.uk
- text/x-csrc attachment: slisttest.c
- application/octet-stream attachment: 0001-Modify-slist_append-to-stop-failure-on-NULL-data.patch
- application/octet-stream attachment: 0002-Modified-curl_list_append-man-page.patch