Commit f5b9e3b9 authored by Committed by Derek Foreman
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: Pekka Paalanen <firstname.lastname@example.org> Reviewed-by: Derek Foreman <email@example.com> Style changes by Derek Foreman
Showing with 17 additions and 9 deletions