mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-15 21:58:06 +02:00
malloc null check
This commit is contained in:
parent
6876138c5a
commit
53dde33e20
1 changed files with 3 additions and 0 deletions
|
|
@ -4051,6 +4051,9 @@ _cairo_svg_surface_show_text_glyphs_impl (cairo_svg_stream_t *output,
|
|||
return status;
|
||||
}
|
||||
char * utf8_str = _cairo_malloc_ab(utf8_len + 1, sizeof(char));
|
||||
if (unlikely (utf8_str == NULL)) {
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
}
|
||||
strncpy(utf8_str, utf8, utf8_len);
|
||||
utf8_str[utf8_len] = '\0';
|
||||
_cairo_svg_stream_printf (output,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue