summaryrefslogtreecommitdiff
path: root/test/overflow.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in doxygen and source commentsluz paz2022-03-281-1/+1
|
* Fix malloc overflow check warningAdrian Johnson2021-08-241-0/+214
To fix this warning: ../src/cairo-malloc-private.h:83:32: warning: comparison is always false due to limited range of data type [-Wtype-limits] 83 | ((size) != 0 && (size_t) (a) >= SIZE_MAX / (size_t) (size) ? NULL : \ | ^~ Create two new macros to do the overflow checks: _cairo_addl_size_t_overflow and _cairo_mul_size_t_overflow. Implement them using compiler builtins where available. Update cairo-malloc-private to use these fuctions and add an overflow test to test the functions.