diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-03 23:19:10 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 00:42:29 +0100 |
commit | e49bcde27f88e21d5b8037a0089a226096f6514b (patch) | |
tree | 81093fdb6b2288c7338c73da2936812e3362489c /src/cairo-polygon.c | |
parent | 8cba73a36c4ec42601388bb9374f3182651bfe60 (diff) | |
download | cairo-e49bcde27f88e21d5b8037a0089a226096f6514b.tar.gz |
[malloc] Check for integer overflow when realloc'ing.
Perform similar sanity checks to Vlad's _cairo_malloc_ab() but on the
arguments to realloc instead.
Diffstat (limited to 'src/cairo-polygon.c')
-rw-r--r-- | src/cairo-polygon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-polygon.c b/src/cairo-polygon.c index 7128e4b5b..3aa0c4cde 100644 --- a/src/cairo-polygon.c +++ b/src/cairo-polygon.c @@ -97,7 +97,8 @@ _cairo_polygon_grow (cairo_polygon_t *polygon) if (new_edges) memcpy (new_edges, polygon->edges, old_size * sizeof (cairo_edge_t)); } else { - new_edges = realloc (polygon->edges, new_size * sizeof (cairo_edge_t)); + new_edges = _cairo_realloc_ab (polygon->edges, + new_size, sizeof (cairo_edge_t)); } if (new_edges == NULL) { |