[PATCH libinput] util: abort if we try to allocate more than a MB

Peter Hutterer peter.hutterer at who-t.net
Wed Jun 20 09:03:54 UTC 2018


On Wed, Jun 20, 2018 at 09:12:54AM +0200, Jan Engelhardt wrote:
> On Wednesday 2018-06-20 02:22, Matheus Santana wrote:
> 
> >Reviewed-by: Matheus Santana <embs at cin.ufpe.br>
> >
> >The check for negatives isn't needed anymore?
> 
> It indeed is not, since a (size_t)-1 is generally greater than 1048576.

still good to leave it in as test case though, just in case we end up taking
the limit out at some point. Whether it's justified or not depends on
the use-case then, but tripping up during a test run is always good.

Cheers,
   Peter

> 
> >      Let's put a cap on for one MB, anything above that is likely some memory
> >      corruption and should be caught early.


More information about the wayland-devel mailing list