1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-11 03:19:46 +01:00

Disallow negative size values in BinaryBlob

This commit is contained in:
Ethan Lee 2020-06-14 22:43:58 -04:00
parent 4894639b3a
commit bd71fb8a68

View file

@ -105,6 +105,10 @@ bool binaryBlob::unPackBinary(const char* name)
{ {
continue; /* Must be EXACTLY 1 or 0 */ continue; /* Must be EXACTLY 1 or 0 */
} }
if (size < 1)
{
continue; /* Must be nonzero and positive */
}
if ((offset + m_headers[i].size) > size) if ((offset + m_headers[i].size) > size)
{ {
continue; /* Bogus size value */ continue; /* Bogus size value */