libevent: endless loop on excessively large buffers

2019-05-02 Thread Tobias Stoeckmann
It is possible to trigger an endless loop or out of boundary write on 64 bit systems with evbuffer_readline calls for buffers which exceed 4 GB (i.e. overflow uint). for (i = 0; i < len; i++) Variable i is unsigned int and len size_t. This leads to an endless loop if len is larger than UI

Re: libevent: endless loop on excessively large buffers

2019-05-02 Thread Nicholas Marriott
ok nicm On Thu, May 02, 2019 at 06:59:33PM +0200, Tobias Stöckmann wrote: > It is possible to trigger an endless loop or out of boundary write > on 64 bit systems with evbuffer_readline calls for buffers which > exceed 4 GB (i.e. overflow uint). > > for (i = 0; i < len; i++) > > Variab

Re: libevent: endless loop on excessively large buffers

2019-05-02 Thread Ted Unangst
Tobias Stöckmann wrote: > Generally this is a rather theoretical case. Normal users are not > allowed to allocate so much memory. But better be safe than sorry, > especially if login.conf values were adjusted (or the process runs > as root). > > This patch completely removes "unsigned int" from bu

libevent: endless loop on excessively large buffers

2019-05-02 Thread Tobias Stöckmann
It is possible to trigger an endless loop or out of boundary write on 64 bit systems with evbuffer_readline calls for buffers which exceed 4 GB (i.e. overflow uint). for (i = 0; i < len; i++) Variable i is unsigned int and len size_t. This leads to an endless loop if len is larger than UI