Mailing List Archive

Re: svn commit: r1874102 - /httpd/httpd/trunk/modules/http/http_filters.c
On 02/17/2020 09:20 AM, jorton@apache.org wrote:
> Author: jorton
> Date: Mon Feb 17 08:20:52 2020
> New Revision: 1874102
>
> URL: http://svn.apache.org/viewvc?rev=1874102&view=rev
> Log:
> * modules/http/http_filters.c (parse_chunk_size): Reduce by four the
> limit to the number of bits that can be handled in a chunk size, to
> avoid undefined behaviour bitshifting a signed integer left. Max
> chunk size on 32-bit arch is now 32MiB. Avoids UBSan error in:

Why 32 MiB? 32 bit - 4 are 28 bit we should be able to store 256 MiB if read as unsigned or 128 MiB signed.

Regards

RĂ¼diger
Re: svn commit: r1874102 - /httpd/httpd/trunk/modules/http/http_filters.c [ In reply to ]
On Mon, Feb 17, 2020 at 10:01:17AM +0100, Ruediger Pluem wrote:
> On 02/17/2020 09:20 AM, jorton@apache.org wrote:
> > Author: jorton
> > Date: Mon Feb 17 08:20:52 2020
> > New Revision: 1874102
> >
> > URL: http://svn.apache.org/viewvc?rev=1874102&view=rev
> > Log:
> > * modules/http/http_filters.c (parse_chunk_size): Reduce by four the
> > limit to the number of bits that can be handled in a chunk size, to
> > avoid undefined behaviour bitshifting a signed integer left. Max
> > chunk size on 32-bit arch is now 32MiB. Avoids UBSan error in:
>
> Why 32 MiB? 32 bit - 4 are 28 bit we should be able to store 256 MiB if read as unsigned or 128 MiB signed.

Errr, you are right, no idea how I came up with that, maths before
coffee clearly not a good idea. I amended the log entry, thanks :)