1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Check for negative record list length

This commit is contained in:
elsid 2022-09-18 16:00:00 +02:00
parent 0688b6de40
commit 06f7e8088e
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625

View file

@ -92,6 +92,9 @@ namespace Nif
{ {
const int length = nif->getInt(); const int length = nif->getInt();
if (length < 0)
throw std::runtime_error("Negative NIF record list length: " + std::to_string(length));
list.resize(static_cast<std::size_t>(length)); list.resize(static_cast<std::size_t>(length));
for (auto& value : list) for (auto& value : list)