]> granicus.if.org Git - curl/commitdiff
parseurl: move back buffer to function scope
authorDaniel Stenberg <daniel@haxx.se>
Tue, 17 Jan 2017 23:01:03 +0000 (00:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 17 Jan 2017 23:01:03 +0000 (00:01 +0100)
Regression since 1d4202ad, which moved the buffer into a more narrow
scope, but the data in that buffer was used outside of that more narrow
scope.

Reported-by: Dan Fandrich
Bug: https://curl.haxx.se/mail/lib-2017-01/0093.html

lib/url.c

index edae1e3f3719a32a550730b916f8e51c9ad8b016..cbf19628cd012d5fa297b4307c0b82531ed2f5eb 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4280,6 +4280,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
   CURLcode result;
   bool rebuild_url = FALSE;
   bool url_has_scheme = FALSE;
+  char protobuf[16];
 
   *prot_missing = FALSE;
 
@@ -4409,7 +4410,6 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
   }
   else {
     /* clear path */
-    char protobuf[16];
     char slashbuf[4];
     path[0]=0;