Fix out-of-bounds write when STL file node name is too long

pull/450/head
Turo Lamminen 2015-01-28 16:06:01 +02:00
parent f971b66c47
commit 792da49933
1 changed files with 3 additions and 0 deletions

View File

@ -229,6 +229,9 @@ void STLImporter::LoadASCIIFile()
size_t temp;
// setup the name of the node
if ((temp = (size_t)(sz-szMe))) {
if (temp >= MAXLEN) {
throw DeadlyImportError( "STL: Node name too long" );
}
pScene->mRootNode->mName.length = temp;
memcpy(pScene->mRootNode->mName.data,szMe,temp);