]> granicus.if.org Git - graphviz/commitdiff
use safer snprintf in agnameof()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 17:24:34 +0000 (10:24 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Oct 2020 01:46:51 +0000 (18:46 -0700)
lib/cgraph/id.c

index a03cec5f6a98af12d47b18cf5f7c8ab4d964b56e..96aaa912c3f41bcfb7e620e1df2255fa4c293236 100644 (file)
@@ -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