mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
allocator_avl: return 0 for improper size_at call
In case the given address is not the start of a block bail instead of making improper size assumptions. Issue #4325.
This commit is contained in:
parent
49bf58a2ae
commit
98385a7658
@ -401,6 +401,9 @@ size_t Allocator_avl_base::size_at(void const *addr) const
|
||||
/* lookup corresponding block */
|
||||
Block *b = _find_by_address(reinterpret_cast<addr_t>(addr));
|
||||
|
||||
if (b && (b->addr() != (addr_t)addr))
|
||||
return 0;
|
||||
|
||||
return (b && b->used()) ? b->size() : 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user