1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

Curl_pp_readresp: use memmove not memcpy, possibly overlapping areas

Fixes commit 1deac31eba7
This commit is contained in:
Daniel Stenberg 2013-12-24 21:29:18 +01:00
parent 08e57f916c
commit 2618e4caae

View File

@ -377,7 +377,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
/* This is the end of the last line, copy the last line to the /* This is the end of the last line, copy the last line to the
start of the buffer and zero terminate, for old times sake */ start of the buffer and zero terminate, for old times sake */
size_t n = ptr - pp->linestart_resp; size_t n = ptr - pp->linestart_resp;
memcpy(buf, pp->linestart_resp, n); memmove(buf, pp->linestart_resp, n);
buf[n]=0; /* zero terminate */ buf[n]=0; /* zero terminate */
keepon=FALSE; keepon=FALSE;
pp->linestart_resp = ptr+1; /* advance pointer */ pp->linestart_resp = ptr+1; /* advance pointer */