diff --git a/lib/url.c b/lib/url.c
index 62a4148c7bb3f32016674bddcc0728ba4ab78b49..ac2b6be9683083c36c421ed30593ea74e27127f7 100644
--- 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);
       }
     }