]> granicus.if.org Git - curl/commitdiff
Curl_init_do: handle NULL connection pointer passed in
authorLyman Epp <lyman.epp@csgi.com>
Tue, 12 Jun 2018 22:17:30 +0000 (17:17 -0500)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 13 Jun 2018 07:21:40 +0000 (09:21 +0200)
Closes #2653

lib/url.c

index 817baaa080886be29efa71066202ead6493fbd39..d29eddaea74a0296775538360b4b728c164ce803 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4711,16 +4711,18 @@ CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn)
 {
   struct SingleRequest *k = &data->req;
 
-  conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to
-                                 use */
+  if(conn) {
+    conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to
+                                   use */
+    /* if the protocol used doesn't support wildcards, switch it off */
+    if(data->state.wildcardmatch &&
+       !(conn->handler->flags & PROTOPT_WILDCARD))
+      data->state.wildcardmatch = FALSE;
+  }
 
   data->state.done = FALSE; /* *_done() is not called yet */
   data->state.expect100header = FALSE;
 
-  /* if the protocol used doesn't support wildcards, switch it off */
-  if(data->state.wildcardmatch &&
-     !(conn->handler->flags & PROTOPT_WILDCARD))
-    data->state.wildcardmatch = FALSE;
 
   if(data->set.opt_no_body)
     /* in HTTP lingo, no body means using the HEAD request... */