]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/http: use memmove() for session buffer write
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 7 Jan 2021 12:36:49 +0000 (13:36 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 7 Jan 2021 12:49:45 +0000 (13:49 +0100)
Since session buffer contains both the raw http data and the resulting
decoded DNS packet, memmove() should be used instead of memcpy().

daemon/http.c

index 7e52b8dfd4dd54a2f65b36e3183e11b30d16b27b..f72465f65e1313e187cd763815077d0a416fa8ee 100644 (file)
@@ -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;
 }