summaryrefslogtreecommitdiff
path: root/src/cairo-pen.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-10-03 23:19:10 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-10-04 00:42:29 +0100
commite49bcde27f88e21d5b8037a0089a226096f6514b (patch)
tree81093fdb6b2288c7338c73da2936812e3362489c /src/cairo-pen.c
parent8cba73a36c4ec42601388bb9374f3182651bfe60 (diff)
downloadcairo-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-pen.c')
-rw-r--r--src/cairo-pen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index 8d5401db5..471849b01 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -142,7 +142,8 @@ _cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points)
int i;
num_vertices = pen->num_vertices + num_points;
- vertices = realloc (pen->vertices, num_vertices * sizeof (cairo_pen_vertex_t));
+ vertices = _cairo_realloc_ab (pen->vertices,
+ num_vertices, sizeof (cairo_pen_vertex_t));
if (vertices == NULL) {
_cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;