From: Matthew Fernandez Date: Sat, 27 Aug 2022 15:50:12 +0000 (-0700) Subject: cgraph storeFileName: fix unchecked allocation failure X-Git-Tag: 6.0.1~19^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ff2dc62eaf455f08d010b4dd05c7d1f18e6831a;p=graphviz cgraph storeFileName: fix unchecked allocation failure --- diff --git a/lib/cgraph/scan.l b/lib/cgraph/scan.l index db6b6be88..078f16711 100644 --- a/lib/cgraph/scan.l +++ b/lib/cgraph/scan.l @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -98,7 +99,7 @@ storeFileName (char* fname, int len) static char* buf; if (len > cnt) { - buf = realloc (buf, len+1); + buf = gv_realloc(buf, cnt + 1, len + 1); cnt = len; } strcpy (buf, fname);