From 5ee042068b11927241c34b865da3753e56992548 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 31 Jul 2022 09:17:16 -0700 Subject: [PATCH] Pango plugin gv_get_ps_fontlist: fix unchecked allocation --- plugin/pango/gvgetfontlist_pango.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/pango/gvgetfontlist_pango.c b/plugin/pango/gvgetfontlist_pango.c index d91d60d16..c04d1476e 100644 --- a/plugin/pango/gvgetfontlist_pango.c +++ b/plugin/pango/gvgetfontlist_pango.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* FIXME - the following declaration should be removed @@ -338,7 +339,7 @@ static availfont_t *gv_get_ps_fontlist(PangoFontMap * fontmap) pango_font_map_list_families(fontmap, &families, &n_families); /* Setup a pointer to available font structs */ - gv_af_p = N_NEW(GV_FONT_LIST_SIZE, availfont_t); + gv_af_p = gv_calloc(GV_FONT_LIST_SIZE, sizeof(availfont_t)); for (size_t j = 0; j < GV_FONT_LIST_SIZE; j++) { /* get the Graphviz PS font information and create the -- 2.40.0