From: yunwei <37897161+dyunwei@users.noreply.github.com> Date: Wed, 20 Jan 2021 06:12:51 +0000 (+0800) Subject: Update netevent.c X-Git-Tag: release-1.13.2rc1~274^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=021550026146fa05adbc440dc172ea585ac24746;p=thirdparty%2Funbound.git 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. --- 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));