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:
parent
26da5adf98
commit
73398e7e0b
|
|
@ -1961,7 +1961,8 @@ extOutputDevices(def, transList, outFile)
|
||||||
{
|
{
|
||||||
node = extTransRec.tr_termnode[extTransRec.tr_nterm - 1];
|
node = extTransRec.tr_termnode[extTransRec.tr_nterm - 1];
|
||||||
(void) strcat(mesg, ";\n connecting remainder to node ");
|
(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)
|
while (extTransRec.tr_nterm < nsd)
|
||||||
{
|
{
|
||||||
extTransRec.tr_termlen[extTransRec.tr_nterm] = 0;
|
extTransRec.tr_termlen[extTransRec.tr_nterm] = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue