Re: [PATCH 1 of 2] HTTP: uniform overflow checks in ngx_http_alloc_large_header_buffer

2023-11-29 Thread Maxim Dounin
Hello! On Wed, Nov 29, 2023 at 11:24:03AM +0300, Vladimir Homutov via nginx-devel wrote: > On Tue, Nov 28, 2023 at 05:58:23AM +0300, Maxim Dounin wrote: > > Hello! > > > > On Fri, Nov 10, 2023 at 12:11:54PM +0300, Vladimir Homutov via nginx-devel > > wrote: > > > > > If URI is not fully parsed

Re: [PATCH 1 of 2] HTTP: uniform overflow checks in ngx_http_alloc_large_header_buffer

2023-11-29 Thread Vladimir Homutov via nginx-devel
On Tue, Nov 28, 2023 at 05:58:23AM +0300, Maxim Dounin wrote: > Hello! > > On Fri, Nov 10, 2023 at 12:11:54PM +0300, Vladimir Homutov via nginx-devel > wrote: > > > If URI is not fully parsed yet, some pointers are not set. > > As a result, the calculation of "new + (ptr - old)" expression > >

Re: [PATCH 1 of 2] HTTP: uniform overflow checks in ngx_http_alloc_large_header_buffer

2023-11-27 Thread Maxim Dounin
Hello! On Fri, Nov 10, 2023 at 12:11:54PM +0300, Vladimir Homutov via nginx-devel wrote: > If URI is not fully parsed yet, some pointers are not set. > As a result, the calculation of "new + (ptr - old)" expression > may overflow. In such a case, just avoid calculating it, as value > will be

[PATCH 1 of 2] HTTP: uniform overflow checks in ngx_http_alloc_large_header_buffer

2023-11-10 Thread Vladimir Homutov via nginx-devel
If URI is not fully parsed yet, some pointers are not set. As a result, the calculation of "new + (ptr - old)" expression may overflow. In such a case, just avoid calculating it, as value will be set correctly later by the parser in any case. The issue was found by GCC undefined behaviour