Skip to content

Commit d59993d

Browse files
ewalt1rlubos
authored andcommitted
net: lib: download_client: use memmove when copying payload
This is necessary since the buffers can technically overlap. Signed-off-by: Nick Ewalt <[email protected]>
1 parent 3d9570b commit d59993d

File tree

1 file changed

+2
-2
lines changed
  • subsys/net/lib/download_client/src

1 file changed

+2
-2
lines changed

subsys/net/lib/download_client/src/http.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ int http_parse(struct download_client *client, size_t len)
265265
*/
266266
LOG_DBG("Copying %u payload bytes",
267267
client->offset - hdr_len);
268-
memcpy(client->buf, client->buf + hdr_len,
269-
client->offset - hdr_len);
268+
memmove(client->buf, client->buf + hdr_len,
269+
client->offset - hdr_len);
270270

271271
client->offset -= hdr_len;
272272
} else {

0 commit comments

Comments
 (0)