summaryrefslogtreecommitdiff
path: root/src/cairo-quartz-surface.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2017-07-08 09:28:03 +0930
committerBryce Harrington <bryce@osg.samsung.com>2018-05-07 16:35:51 -0700
commit199823938780c8e50099b627d3e9137acba7a263 (patch)
tree858c70f2a9c116ed2a5ffcb05cd9d8d3fe18a4cb /src/cairo-quartz-surface.c
parent7554822dd0b52d33ec7898e81b59e97164b00142 (diff)
downloadcairo-199823938780c8e50099b627d3e9137acba7a263.tar.gz
Use _cairo_malloc instead of malloc
_cairo_malloc(0) always returns NULL, but has not been used consistently. This patch replaces many calls to malloc() with _cairo_malloc(). Fixes: fdo# 101547 CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'src/cairo-quartz-surface.c')
-rw-r--r--src/cairo-quartz-surface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index e047b2280..65d03080a 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -826,7 +826,7 @@ _cairo_surface_to_cgimage (cairo_surface_t *source,
}
}
- source_img = malloc (sizeof (quartz_source_image_t));
+ source_img = _cairo_malloc (sizeof (quartz_source_image_t));
if (unlikely (source_img == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -984,7 +984,7 @@ _cairo_quartz_cairo_repeating_surface_pattern_to_quartz (cairo_quartz_surface_t
if (unlikely (status))
return status;
- info = malloc (sizeof (SurfacePatternDrawInfo));
+ info = _cairo_malloc (sizeof (SurfacePatternDrawInfo));
if (unlikely (!info))
return CAIRO_STATUS_NO_MEMORY;
@@ -2253,7 +2253,7 @@ _cairo_quartz_surface_create_internal (CGContextRef cgContext,
quartz_ensure_symbols ();
/* Init the base surface */
- surface = malloc (sizeof (cairo_quartz_surface_t));
+ surface = _cairo_malloc (sizeof (cairo_quartz_surface_t));
if (unlikely (surface == NULL))
return (cairo_quartz_surface_t*) _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));