Skip to content

Conversation

@arut
Copy link
Contributor

@arut arut commented Apr 18, 2025

After fixing ngx_http_v3_encode_varlen_int() in 400eb1b, NGX_HTTP_V3_VARLEN_INT_LEN retained the old value of 4, which is insufficient for the values over 1073741823 (1G - 1).

The NGX_HTTP_V3_VARLEN_INT_LEN macro is used in ngx_http_v3_uni.c to format stream and frame types. Old buffer size is enough for formatting this data. Also, the macro is used in ngx_http_v3_filter_module.c to format output chunks and trailers. Considering output_buffers and proxy_buffer_size are below 1G in all realistic scenarios, the old buffer size is enough here as well.

After fixing ngx_http_v3_encode_varlen_int() in 400eb1b,
NGX_HTTP_V3_VARLEN_INT_LEN retained the old value of 4, which is
insufficient for the values over 1073741823 (1G - 1).

The NGX_HTTP_V3_VARLEN_INT_LEN macro is used in ngx_http_v3_uni.c to
format stream and frame types.  Old buffer size is enough for formatting
this data.  Also, the macro is used in ngx_http_v3_filter_module.c to
format output chunks and trailers.  Considering output_buffers and
proxy_buffer_size are below 1G in all realistic scenarios, the old buffer
size is enough here as well.
@arut arut requested a review from pluknet April 18, 2025 11:19
@arut arut merged commit 0f9f43b into nginx:master Apr 18, 2025
1 check passed
@arut arut deleted the v3-varint branch April 18, 2025 11:28
@Maryna-f5 Maryna-f5 added this to the nginx-1.27.6 milestone Apr 18, 2025
@arut
Copy link
Contributor Author

arut commented Apr 22, 2025

For the record, this was found while compiling by gcc-14 with the following options: --with-cc-opt="-O3 -flto=auto".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants