gcr/gcrShwFlgs.c: Likely overrunning write
Fix code scanning alert no. 2: Likely overrunning write (#5) * Fix code scanning alert no. 2: Likely overrunning write Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Update gcrShwFlgs.c * AI added snprintf(), DLM increased buffer for enough space for rounded/aligned 64bit %p --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
881115a856
commit
fed93c200d
|
|
@ -203,14 +203,14 @@ void
|
||||||
gcrDumpChannel(ch)
|
gcrDumpChannel(ch)
|
||||||
GCRChannel * ch;
|
GCRChannel * ch;
|
||||||
{
|
{
|
||||||
char name[20];
|
char name[32];
|
||||||
int track, col, netCount = 0, gcrNetName();
|
int track, col, netCount = 0, gcrNetName();
|
||||||
short res;
|
short res;
|
||||||
GCRNet * net, * netNames[500];
|
GCRNet * net, * netNames[500];
|
||||||
FILE * fp, * fopen();
|
FILE * fp, * fopen();
|
||||||
|
|
||||||
netNames[0]=(GCRNet *) 0;
|
netNames[0]=(GCRNet *) 0;
|
||||||
(void) sprintf(name, "channel.%p", ch);
|
(void) snprintf(name, sizeof(name), "channel.%p", ch);
|
||||||
if((fp = fopen(name, "w")) == NULL)
|
if((fp = fopen(name, "w")) == NULL)
|
||||||
{
|
{
|
||||||
TxError("Can't open file %s to dump channel.\n", name);
|
TxError("Can't open file %s to dump channel.\n", name);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue