You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2020/02/17 09:01:17 UTC

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

Posted by Joe Orton <jo...@redhat.com>.
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 :)