summaryrefslogtreecommitdiff
path: root/src/cairo-tag-attributes.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-tag-attributes.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-tag-attributes.c')
-rw-r--r--src/cairo-tag-attributes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-tag-attributes.c b/src/cairo-tag-attributes.c
index 91cd5aebf..44b1147fb 100644
--- a/src/cairo-tag-attributes.c
+++ b/src/cairo-tag-attributes.c
@@ -267,7 +267,7 @@ parse_string (const char *p, char **s)
if (!end)
return NULL;
- *s = malloc (len + 1);
+ *s = _cairo_malloc (len + 1);
decode_string (p, &len, *s);
(*s)[len] = 0;
@@ -341,7 +341,7 @@ parse_name (const char *p, const char **end, char **s)
p2++;
len = p2 - p;
- name = malloc (len + 1);
+ name = _cairo_malloc (len + 1);
if (unlikely (name == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);