mirror of
https://github.com/monero-project/monero.git
synced 2025-12-16 03:51:28 +09:00
epee: basic sanity check on allocation size from untrusted source
Reported by guidov
This commit is contained in:
parent
3395de2e7f
commit
b873b69ded
@ -136,6 +136,7 @@ namespace epee
|
|||||||
//for pod types
|
//for pod types
|
||||||
array_entry_t<type_name> sa;
|
array_entry_t<type_name> sa;
|
||||||
size_t size = read_varint();
|
size_t size = read_varint();
|
||||||
|
CHECK_AND_ASSERT_THROW_MES(size <= m_count, "Size sanity check failed");
|
||||||
sa.reserve(size);
|
sa.reserve(size);
|
||||||
//TODO: add some optimization here later
|
//TODO: add some optimization here later
|
||||||
while(size--)
|
while(size--)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user