mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09: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:
parent
7903b8967e
commit
6991b2045d
1 changed files with 2 additions and 0 deletions
|
@ -98,10 +98,12 @@ bool binaryBlob::unPackBinary(const char* name)
|
||||||
}
|
}
|
||||||
if (m_headers[i].size < 1)
|
if (m_headers[i].size < 1)
|
||||||
{
|
{
|
||||||
|
m_headers[i].valid = false;
|
||||||
continue; /* Must be nonzero and positive */
|
continue; /* Must be nonzero and positive */
|
||||||
}
|
}
|
||||||
if ((offset + m_headers[i].size) > size)
|
if ((offset + m_headers[i].size) > size)
|
||||||
{
|
{
|
||||||
|
m_headers[i].valid = false;
|
||||||
continue; /* Bogus size value */
|
continue; /* Bogus size value */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue