From b9460dd9591583fa287cf031bf57629bffb20a84 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 8 Aug 2023 16:01:00 +0000 Subject: [PATCH] Fix UNKNOWN READ in std::__1::basic_string, std::__1::allocator #include #include +#include using namespace Assimp; @@ -160,6 +161,9 @@ void NDOImporter::InternReadFile( const std::string& pFile, temp = file_format >= 12 ? reader.GetU4() : reader.GetU2(); head = (const char*)reader.GetPtr(); + if (std::numeric_limits::max() - 76 < temp) { + throw DeadlyImportError("Invalid name length"); + } reader.IncPtr(temp + 76); /* skip unknown stuff */ obj.name = std::string(head, temp);