Commit graph

2 commits

Author SHA1 Message Date
luz paz
25d588e6c0 Fix typos in doxygen and source comments 2022-03-28 16:43:03 -04:00
Adrian Johnson
068e9b2eb4 Fix malloc overflow check warning
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.
2021-08-24 07:26:35 +09:30