Q3DLoader: Fix possible material string overflow (#5556)

- closes https://github.com/assimp/assimp/issues/5555
pull/5542/head^2
Kim Kulling 2024-04-26 10:11:19 +01:00 committed by GitHub
parent 7bda0f88ca
commit c05895f3c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -250,6 +250,10 @@ void Q3DImporter::InternReadFile(const std::string &pFile,
c = stream.GetI1();
while (c) {
mat.name.data[mat.name.length++] = c;
if (mat.name.length == MAXLEN) {
ASSIMP_LOG_ERROR("String ouverflow detected, skipped material name parsing.");
break;
}
c = stream.GetI1();
}