]> granicus.if.org Git - curl/commitdiff
overlapping memory chunks with strcpy(), detected by the friendly valgrind
authorDaniel Stenberg <daniel@haxx.se>
Tue, 28 Oct 2003 09:17:15 +0000 (09:17 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Oct 2003 09:17:15 +0000 (09:17 +0000)
lib/url.c

index 62a4148c7bb3f32016674bddcc0728ba4ab78b49..ac2b6be9683083c36c421ed30593ea74e27127f7 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2035,7 +2035,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
              used truly as a separator */
           ptr++;
 
-        strcpy(conn->path, ptr);
+        /* This cannot be made with strcpy, as the memory chunks overlap! */
+        memmove(conn->path, ptr, strlen(ptr)+1);
       }
     }