From: Tomas Krizek Date: Thu, 7 Jan 2021 12:36:49 +0000 (+0100) Subject: daemon/http: use memmove() for session buffer write X-Git-Tag: v5.3.0~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd8efd4870ff2833ed7bda79a112e8888c90794d;p=thirdparty%2Fknot-resolver.git daemon/http: use memmove() for session buffer write Since session buffer contains both the raw http data and the resulting decoded DNS packet, memmove() should be used instead of memcpy(). --- diff --git a/daemon/http.c b/daemon/http.c index 7e52b8dfd..f72465f65 100644 --- a/daemon/http.c +++ b/daemon/http.c @@ -362,7 +362,7 @@ static int data_chunk_recv_callback(nghttp2_session *h2, uint8_t flags, int32_t queue_push(ctx->streams, stream_id); } - memcpy(ctx->buf + ctx->buf_pos, data, len); + memmove(ctx->buf + ctx->buf_pos, data, len); ctx->buf_pos += len; return 0; }