From: Matthew Fernandez Date: Sat, 24 Oct 2020 17:13:39 +0000 (-0700) Subject: use safer snprintf in write_nodename() X-Git-Tag: 2.46.0~20^2^2~4^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75cb2f8f5841081b727ca6d0981634dc05cbf0d4;p=graphviz use safer snprintf in write_nodename() --- diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index 0f432c980..4b3d8f7b9 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -506,7 +506,7 @@ static int write_nodename(Agnode_t * n, iochan_t * ofile) CHKRV(write_canonstr(g, ofile, name)); } else { char buf[sizeof("__SUSPECT") + 20]; - sprintf(buf, "_%ld_SUSPECT", AGID(n)); /* could be deadly wrong */ + snprintf(buf, sizeof(buf), "_%ld_SUSPECT", AGID(n)); /* could be deadly wrong */ CHKRV(ioput(g, ofile, buf)); } return 0;