From 58047f3e3adc1cea04fa1f79f6070418c2352303 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 24 Oct 2020 10:24:34 -0700 Subject: [PATCH] use safer snprintf in agnameof() --- lib/cgraph/id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cgraph/id.c b/lib/cgraph/id.c index a03cec5f6..96aaa912c 100644 --- a/lib/cgraph/id.c +++ b/lib/cgraph/id.c @@ -152,7 +152,7 @@ char *agnameof(void *obj) } if (AGTYPE(obj) != AGEDGE) { static char buf[32]; - sprintf(buf, "%c%ld", LOCALNAMEPREFIX, AGID(obj)); + snprintf(buf, sizeof(buf), "%c%ld", LOCALNAMEPREFIX, AGID(obj)); rv = buf; } else -- 2.40.0