From 021550026146fa05adbc440dc172ea585ac24746 Mon Sep 17 00:00:00 2001 From: yunwei <37897161+dyunwei@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:12:51 +0800 Subject: [PATCH] Update netevent.c #386 I found the root cause of this issue. r_buffer is r->query_reply.c->buffer, used to fill the reply in the mesh_send_reply function, then call comm_point_send_reply, and then call http2_submit_dns_response to send the DOH response. However, the buffer is not cleared after use. If the query length is greater than the last response length, the next dns query in the same H2 session will encounter an error. This is bug!!! Clear the buffer after use. --- util/netevent.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/netevent.c b/util/netevent.c index a2c0e6073..893c1ddbf 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -3994,6 +3994,7 @@ comm_point_send_reply(struct comm_reply *repinfo) } repinfo->c->h2_stream = NULL; repinfo->c->tcp_is_reading = 0; + sldns_buffer_clear(repinfo->c->buffer); comm_point_stop_listening(repinfo->c); comm_point_start_listening(repinfo->c, -1, adjusted_tcp_timeout(repinfo->c));