mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user