]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: finalize chunked response body chain with NULL.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 17 Nov 2020 21:12:36 +0000 (21:12 +0000)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 17 Nov 2020 21:12:36 +0000 (21:12 +0000)
Unfinalized chain could result in segfault.  The problem was introduced in
ef83990f0e25.

Patch by Andrey Kolyshkin.

src/http/modules/ngx_http_chunked_filter_module.c

index 371559e2fd00e3c876dab04e5528360b9a6e8b89..138369815a93699aa65300e986dbcaad99d75e21 100644 (file)
@@ -216,6 +216,9 @@ ngx_http_chunked_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
             cl->buf->last_buf = 0;
 
             *ll = tl;
+
+        } else {
+            *ll = NULL;
         }
 
     } else