Skip to content

Casting operands to a wider type to prevent integer overflow

Fufu Fang requested to merge fufu.fang.arm/vulkan-wsi-layer:master into master

Previously the calculation for total_size was done in 32-bits, as the operands were all 32-bit signed or unsigned integers. This led to integer overflow when the extent being allocated is too large. total_size is finally cast to size_t, as the kernel UAPI for ION uses size_t.

Change-Id: I7a76b2c18be25fda0bf6ef70cd8a6fe717c2903c Signed-off-by: Fufu Fang fufu.fang@arm.com

Merge request reports