Q3DLoader: Fix possible material string overflow

- closes https://github.com/assimp/assimp/issues/5555
pull/5556/head
Kim Kulling 2024-04-26 10:59:33 +02:00 committed by GitHub
parent 7bda0f88ca
commit 2e9b0ab8af
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();
}