From 2ff2dc62eaf455f08d010b4dd05c7d1f18e6831a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 27 Aug 2022 08:50:12 -0700 Subject: [PATCH] cgraph storeFileName: fix unchecked allocation failure --- lib/cgraph/scan.l | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.50.1