From: Matthew Fernandez Date: Sat, 24 Oct 2020 16:49:36 +0000 (-0700) Subject: switch to safer snprintf in portName() X-Git-Tag: 2.46.0~20^2^2~4^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73db90a0532ed25a0bbead77783a1b2b4352c7d4;p=graphviz switch to safer snprintf in portName() --- diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index 935a59a74..c82126f35 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -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; }