Fix Heap-buffer-overflow READ in ODDLParser::OpenDDLParser::parseFloatingLiteral

pull/5198/head
Alex 2023-08-08 16:47:37 +02:00 committed by GitHub
parent 60989a598e
commit 2c4942a74b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -301,14 +301,15 @@ void OpenGEXImporter::InternReadFile(const std::string &filename, aiScene *pScen
OpenDDLParser myParser;
myParser.setLogCallback(&logDDLParserMessage);
myParser.setBuffer(&buffer[0], buffer.size());
bool success(myParser.parse());
if (success) {
m_ctx = myParser.getContext();
pScene->mRootNode = new aiNode;
pScene->mRootNode->mName.Set(filename);
handleNodes(m_ctx->m_root, pScene);
if (!myParser.parse()) {
throw DeadlyImportError("Failed to parse file ", filename);
}
m_ctx = myParser.getContext();
pScene->mRootNode = new aiNode;
pScene->mRootNode->mName.Set(filename);
handleNodes(m_ctx->m_root, pScene);
copyMeshes(pScene);
copyCameras(pScene);
copyLights(pScene);