]> granicus.if.org Git - curl/commitdiff
parseurlandfillconn(): fix improper non-numeric scope_id stripping.
authorKyle J. McKay <mackyle@gmail.com>
Wed, 17 Dec 2014 14:52:07 +0000 (15:52 +0100)
committerPatrick Monnerat <pm@datasphere.ch>
Wed, 17 Dec 2014 14:52:07 +0000 (15:52 +0100)
Fixes SF bug 1149: http://sourceforge.net/p/curl/bugs/1449/

lib/url.c

index cbc750904380d46b19148fd43df43a4fc4529284..3d6f8fd14f2827f12b6fcb69a2e9f8614a1c8904 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4116,10 +4116,10 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
           }
         }
         if(scopeidx > 0) {
+          char *p = percent + identifier_offset + strlen(ifname);
+
           /* Remove zone identifier from hostname */
-          memmove(percent,
-                  percent + identifier_offset + strlen(ifname),
-                  identifier_offset + strlen(ifname));
+          memmove(percent, p, strlen(p) + 1);
           conn->scope_id = scopeidx;
         }
         else