]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1103: unbound 1.20.0 segmentation fault with nghttp2.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 12 Jul 2024 14:11:29 +0000 (16:11 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 12 Jul 2024 14:11:29 +0000 (16:11 +0200)
doc/Changelog
services/mesh.c
testcode/fake_event.c
util/netevent.c
util/netevent.h

index 14a72306c8537da1b1e874f974cc8992b2f5473d..bc71af26dc0463cf423c1fac083f447e89b39505 100644 (file)
@@ -1,6 +1,9 @@
 12 July 2024: Yorgos
        - Add RPZ tag tests in acl_interface.tdir.
 
+12 July 2024: Wouter
+       - Fix #1103: unbound 1.20.0 segmentation fault with nghttp2.
+
 10 July 2024: Wouter
        - For #773: In contrib/unbound.service.in set unbound to start after
          network-online.target. Also for contrib/unbound_portable.service.in.
index 9797c75262237978522bcab16a21f1b84be07669..d3811b475115085f85685ce770792126c0bd3d5c 100644 (file)
@@ -1576,6 +1576,10 @@ void mesh_query_done(struct mesh_state* mstate)
                                tcp_req_info_remove_mesh_state(r->query_reply.c->tcp_req_info, mstate);
                                r_buffer = NULL;
                        }
+                       if(r->query_reply.c->use_h2) {
+                               http2_stream_remove_mesh_state(
+                                       r->query_reply.c->h2_stream);
+                       }
                        prev = r;
                        prev_buffer = r_buffer;
                }
@@ -2284,6 +2288,9 @@ mesh_serve_expired_callback(void* arg)
                        r, r_buffer, prev, prev_buffer);
                if(r->query_reply.c->tcp_req_info)
                        tcp_req_info_remove_mesh_state(r->query_reply.c->tcp_req_info, mstate);
+               if(r->query_reply.c->use_h2)
+                       http2_stream_remove_mesh_state(
+                               r->query_reply.c->h2_stream);
                infra_wait_limit_dec(mstate->s.env->infra_cache,
                        &r->query_reply, mstate->s.env->cfg);
                prev = r;
index 09269289dd440bb8bd7434c1875fe8d617d4e758..f02a98351b7cc4df9b1a19ff43a7ffe0cc077491 100644 (file)
@@ -1978,4 +1978,8 @@ void http2_stream_add_meshstate(struct http2_stream* ATTR_UNUSED(h2_stream),
 {
 }
 
+void http2_stream_remove_mesh_state(struct http2_stream* ATTR_UNUSED(h2_stream))
+{
+}
+
 /*********** End of Dummy routines ***********/
index 3663144b24ecf17b31ee382f89850441eb442b79..dc5fd63fa6f6185469acfcbfe3a36955168c19e5 100644 (file)
@@ -3307,6 +3307,13 @@ void http2_stream_add_meshstate(struct http2_stream* h2_stream,
        h2_stream->mesh_state = m;
 }
 
+void http2_stream_remove_mesh_state(struct http2_stream* h2_stream)
+{
+       if(!h2_stream)
+               return;
+       h2_stream->mesh_state = NULL;
+}
+
 /** delete http2 session server. After closing connection. */
 static void http2_session_server_delete(struct http2_session* h2_session)
 {
index 1e4a13f9b7e58d7863205c2731f9b4e97f343402..6f43ce56c8c9c9d3570660e57e82c89c693d33e3 100644 (file)
@@ -955,6 +955,9 @@ void http2_session_add_stream(struct http2_session* h2_session,
 void http2_stream_add_meshstate(struct http2_stream* h2_stream,
        struct mesh_area* mesh, struct mesh_state* m);
 
+/** Remove mesh state from stream. When the mesh state has been removed. */
+void http2_stream_remove_mesh_state(struct http2_stream* h2_stream);
+
 /**
  * This routine is published for checks and tests, and is only used internally.
  * handle libevent callback for timer comm.