]> granicus.if.org Git - graphviz/commitdiff
switch to safer snprintf in portName()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 16:49:36 +0000 (09:49 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Oct 2020 01:46:51 +0000 (18:46 -0700)
lib/fdpgen/layout.c

index 935a59a7487661696b924ce9e8be17221a88a32f..c82126f3558d9e888367802082d8c8eb6fb3205b 100644 (file)
@@ -322,8 +322,8 @@ static char *portName(graph_t * g, bport_t * p)
     node_t *t = agtail(e);
     static char buf[BSZ + 1];
 
-       sprintf(buf, "_port_%s_(%d)_(%d)_%u",agnameof(g), ND_id(t), ND_id(h),
-               AGSEQ(e));
+       snprintf(buf, sizeof(buf), "_port_%s_(%d)_(%d)_%u",agnameof(g),
+               ND_id(t), ND_id(h), AGSEQ(e));
     return buf;
 }