summaryrefslogtreecommitdiff
path: root/lib/pipeline.c
diff options
context:
space:
mode:
authorAnders Bakken <agbakken@gmail.com>2016-03-07 11:38:26 -0800
committerDaniel Stenberg <daniel@haxx.se>2016-03-08 00:25:53 +0100
commit46bf7ff78d2e851dafe2d20f003283979b2962f9 (patch)
treef9ef6fad83745d9d46e256cf91f982e65c2db1c9 /lib/pipeline.c
parent7e8b65c00bcaf3e7b6cf8244a556e36ed0a5a22b (diff)
downloadcurl-46bf7ff78d2e851dafe2d20f003283979b2962f9.tar.gz
pipeline: Sanity check pipeline pointer before accessing it.
I got a crash with this stack: curl/lib/url.c:2873 (Curl_removeHandleFromPipeline) curl/lib/url.c:2919 (Curl_getoff_all_pipelines) curl/lib/multi.c:561 (curl_multi_remove_handle) curl/lib/url.c:415 (Curl_close) curl/lib/easy.c:859 (curl_easy_cleanup) Closes #704
Diffstat (limited to 'lib/pipeline.c')
-rw-r--r--lib/pipeline.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/pipeline.c b/lib/pipeline.c
index e4400fdde..95b89b54b 100644
--- a/lib/pipeline.c
+++ b/lib/pipeline.c
@@ -323,10 +323,11 @@ CURLMcode Curl_pipeline_set_server_blacklist(char **servers,
static bool pipe_head(struct SessionHandle *data,
struct curl_llist *pipeline)
{
- struct curl_llist_element *curr = pipeline->head;
- if(curr)
- return (curr->ptr == data) ? TRUE : FALSE;
-
+ if(pipeline) {
+ struct curl_llist_element *curr = pipeline->head;
+ if(curr)
+ return (curr->ptr == data) ? TRUE : FALSE;
+ }
return FALSE;
}