Re: [PATCH 2 of 2] HTTP: suppressed possible overflow in interim r->uri_end calculation

2023-10-27 Thread Maxim Dounin
Hello! On Fri, Oct 27, 2023 at 02:58:45PM +0300, Vladimir Homutov via nginx-devel wrote: > If URI is not fully parsed yet, the r->uri_end pointer is NULL. > As a result, calculation of "new + (r->uri_end - old)" expression > may overflow. In such case, just avoid calculating it, as r->uri_end >

[PATCH 2 of 2] HTTP: suppressed possible overflow in interim r->uri_end calculation

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