diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2017-07-08 09:28:03 +0930 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2018-05-07 16:35:51 -0700 |
commit | 199823938780c8e50099b627d3e9137acba7a263 (patch) | |
tree | 858c70f2a9c116ed2a5ffcb05cd9d8d3fe18a4cb /src/cairo-pdf-shading.c | |
parent | 7554822dd0b52d33ec7898e81b59e97164b00142 (diff) | |
download | cairo-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-pdf-shading.c')
-rw-r--r-- | src/cairo-pdf-shading.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-pdf-shading.c b/src/cairo-pdf-shading.c index 646e2cd49..b114b3104 100644 --- a/src/cairo-pdf-shading.c +++ b/src/cairo-pdf-shading.c @@ -170,7 +170,7 @@ _cairo_pdf_shading_generate_data (cairo_pdf_shading_t *shading, * 4 colors. Each color is stored in 2 bytes * num_color_components. */ shading->data_length = num_patches * (1 + 16 * 2 * 4 + 4 * 2 * num_color_components); - shading->data = malloc (shading->data_length); + shading->data = _cairo_malloc (shading->data_length); if (unlikely (shading->data == NULL)) return _cairo_error (CAIRO_STATUS_NO_MEMORY); |