[PATCH 6 of 7] HTTP/3: fixed handling of zero-length literal field line

Maxim Dounin mdounin at mdounin.ru
Fri May 31 00:58:31 UTC 2024


# HG changeset patch
# User Sergey Kandaurov <pluknet at nginx.com>
# Date 1716902445 -14400
#      Tue May 28 17:20:45 2024 +0400
# Node ID 8eecd832d2711dca1f7d4eff96369cdc3be514f4
# Parent  9e69f2b7026deeed2824422ef64d11e234c05bb1
HTTP/3: fixed handling of zero-length literal field line.

Previously, st->value was passed with NULL data pointer to header handlers.

diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c
--- a/src/http/v3/ngx_http_v3_parse.c
+++ b/src/http/v3/ngx_http_v3_parse.c
@@ -810,6 +810,7 @@ ngx_http_v3_parse_field_lri(ngx_connecti
 
             st->literal.length = st->pint.value;
             if (st->literal.length == 0) {
+                st->value.data = (u_char *) "";
                 goto done;
             }
 
@@ -932,6 +933,7 @@ ngx_http_v3_parse_field_l(ngx_connection
 
             st->literal.length = st->pint.value;
             if (st->literal.length == 0) {
+                st->value.data = (u_char *) "";
                 goto done;
             }
 
@@ -1072,6 +1074,7 @@ ngx_http_v3_parse_field_lpbi(ngx_connect
 
             st->literal.length = st->pint.value;
             if (st->literal.length == 0) {
+                st->value.data = (u_char *) "";
                 goto done;
             }
 




More information about the nginx-devel mailing list