stop progress callbacks after curl_easy_perform returns

This prevents possible null dereferences in FTP transfers when the
progress callback is touched during connection teardown.

http://curl.haxx.se/mail/lib-2011-08/0128.html

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dave Reisner 2011-08-11 08:19:39 -04:00 committed by Dan McGee
parent c4112da8c3
commit edd9ed6a3b
1 changed files with 3 additions and 0 deletions

View File

@ -302,6 +302,9 @@ static int curl_download_internal(struct dload_payload *payload,
/* perform transfer */
handle->curlerr = curl_easy_perform(handle->curl);
/* immediately unhook the progress callback */
curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 1L);
/* was it a success? */
if(handle->curlerr == CURLE_ABORTED_BY_CALLBACK) {
goto cleanup;