Skip to content
Commit f5b9e3b9 authored by Michal Srb's avatar Michal Srb Committed by Derek Foreman
Browse files

connection: Prevent integer overflow in DIV_ROUNDUP.



The DIV_ROUNDUP macro would overflow when trying to round values higher
than MAX_UINT32 - (a - 1). The result is 0 after the division. This is
potential security issue when demarshalling an array because the length
check is performed with the overflowed value, but then the original huge
value is stored for later use.

The issue was present only on 32bit platforms. The use of size_t in the
DIV_ROUNDUP macro already promoted everything to 64 bit size on 64 bit
systems.
Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: default avatarDerek Foreman <derek.foreman.samsung@gmail.com>

Style changes by Derek Foreman
parent fde60465
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment