From 73db90a0532ed25a0bbead77783a1b2b4352c7d4 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 24 Oct 2020 09:49:36 -0700 Subject: [PATCH] switch to safer snprintf in portName() --- lib/fdpgen/layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.40.0