From: Daniel Stenberg Date: Tue, 28 Oct 2003 09:17:15 +0000 (+0000) Subject: overlapping memory chunks with strcpy(), detected by the friendly valgrind X-Git-Tag: curl-7_10_8~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1cdc66d927e6476f422ad3266c34ab766b1260ea;p=thirdparty%2Fcurl.git overlapping memory chunks with strcpy(), detected by the friendly valgrind --- 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); } }