[cairo] Catching int overflows in allocations

Vladimir Vukicevic vladimir at pobox.com
Tue Jun 19 13:25:07 PDT 2007


Ok, converted to _cairo_malloc_ab, _abc, and _ab_plus_c.. also fixed 
other review comments.  Here's the patch:

http://gitweb.cairographics.org/?p=users/vladimir/cairo;a=commit;h=53432690bb2f7fe2c3f69462ef172470176d46d9

It's sitting in an int-overflow branch in my repo.  Most of it is 
boilerplate conversions of malloc(a*sizeof(t)) -> _cairo_malloc_ab(a, 
sizeof(t)) and the like, though there are a few bigger changes.. 
pixregion.c has a bit more work, since it wants to calculate the byte 
size of a region separately from allocating it, and cairo-glitz-surface 
wanted essentially malloc_ab_plus_cd and malloc_ab_plus_cde, so I just
expanded those out in the code.

    - Vlad


More information about the cairo mailing list