Corrected a buffer overrun situation in ExtBasic.c when printing

the "connected other node to. . ." message when terminals of a
device are shorted.  A long enough node name, especially one
created by concatenating hierarchy when flattening a cell, can
easily overrun the short 256-byte string buffer.  Fixed by
changing strcat() to strncat().
This commit is contained in:
Tim Edwards 2023-03-05 16:39:58 -05:00
parent 26da5adf98
commit 73398e7e0b
2 changed files with 3 additions and 2 deletions

View File

@ -1 +1 @@
8.3.373
8.3.374

View File

@ -1961,7 +1961,8 @@ extOutputDevices(def, transList, outFile)
{
node = extTransRec.tr_termnode[extTransRec.tr_nterm - 1];
(void) strcat(mesg, ";\n connecting remainder to node ");
(void) strcat(mesg, extNodeName((LabRegion *) node));
(void) strncat(mesg, extNodeName((LabRegion *) node),
255 - strlen(mesg));
while (extTransRec.tr_nterm < nsd)
{
extTransRec.tr_termlen[extTransRec.tr_nterm] = 0;