Fixed a potential string overrun crash condition when doing
"getnode", as there is no limit on the length of a hierarchical node name, and no check on the string length when copying back into a fixed-length character array.
This commit is contained in:
parent
5ecf10c022
commit
1a16502a69
|
|
@ -93,7 +93,7 @@ SimConnectFunc(
|
|||
TileType loctype, ctype;
|
||||
TileType newdinfo = 0;
|
||||
int i, pNum;
|
||||
static char nodeName[256];
|
||||
static char nodeName[MAXPATHNAME];
|
||||
CellDef *def;
|
||||
TerminalPath *tpath = cx->tc_filter->tf_tpath;
|
||||
|
||||
|
|
@ -133,7 +133,8 @@ SimConnectFunc(
|
|||
char c = *n;
|
||||
|
||||
SigDisableInterrupts();
|
||||
strcpy(nodeName, SimGetNodeName(cx->tc_scx, tile, dinfo, tpath->tp_first));
|
||||
strncpy(nodeName, SimGetNodeName(cx->tc_scx, tile, dinfo, tpath->tp_first),
|
||||
MAXPATHNAME);
|
||||
SigEnableInterrupts();
|
||||
|
||||
*n = c;
|
||||
|
|
|
|||
Loading…
Reference in New Issue