Use strncpy instead of strcpy because again, buffer overflows

This commit is contained in:
Glenn Smith 2018-03-06 01:59:05 -05:00
parent 7769da9434
commit 79c34c68db
92 changed files with 298 additions and 279 deletions

View file

@ -708,7 +708,7 @@ ImplementEnumType(_TamlFormatMode,
U32 nBufferSize = dStrlen(pFieldValue) + 1;
FrameTemp<char> valueCopy(nBufferSize);
dStrcpy((char *)valueCopy, pFieldValue);
dStrcpy((char *)valueCopy, pFieldValue, nBufferSize);
// Skip if field should not be written.
if (!pSimObject->writeField(fieldName, valueCopy))
@ -1547,4 +1547,4 @@ ImplementEnumType(_TamlFormatMode,
TiXmlElement* pAnyElement = new TiXmlElement("xs:any");
pAnyElement->SetAttribute("processContents", "skip");
pSequenceElement->LinkEndChild(pAnyElement);
}
}