1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Set valid to false if size is bogus

This is to prevent callers from parsing bogus sizes. If they listen to
the -1 sentinel value, at least...
This commit is contained in:
Misa 2020-08-14 01:50:41 -07:00 committed by Ethan Lee
parent 7903b8967e
commit 6991b2045d

View file

@ -98,10 +98,12 @@ bool binaryBlob::unPackBinary(const char* name)
}
if (m_headers[i].size < 1)
{
m_headers[i].valid = false;
continue; /* Must be nonzero and positive */
}
if ((offset + m_headers[i].size) > size)
{
m_headers[i].valid = false;
continue; /* Bogus size value */
}