From 1cdc66d927e6476f422ad3266c34ab766b1260ea Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Tue, 28 Oct 2003 09:17:15 +0000
Subject: [PATCH] overlapping memory chunks with strcpy(), detected by the
 friendly valgrind

---
 lib/url.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/url.c b/lib/url.c
index 62a4148c7b..ac2b6be968 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);
       }
     }
 
-- 
GitLab