From: Matthew Fernandez Date: Sat, 24 Oct 2020 17:24:34 +0000 (-0700) Subject: use safer snprintf in agnameof() X-Git-Tag: 2.46.0~20^2^2~4^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58047f3e3adc1cea04fa1f79f6070418c2352303;p=graphviz use safer snprintf in agnameof() --- 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