]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Update netevent.c
authoryunwei <37897161+dyunwei@users.noreply.github.com>
Wed, 20 Jan 2021 06:12:51 +0000 (14:12 +0800)
committerGitHub <noreply@github.com>
Wed, 20 Jan 2021 06:12:51 +0000 (14:12 +0800)
#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

index a2c0e6073e368b98e71e4355144db50c6e6db543..893c1ddbff41eefd02e1725f0d5bf7817da05157 100644 (file)
@@ -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));