mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-07 03:40:15 +00:00
trace_buffer: fix out-of-bounds read
The calculation in next() actually checked whether the current entry fitted into the buffer, not if another one fitted. genodelabs/genode#4430
This commit is contained in:
parent
d7c4265089
commit
44aefc8777
@ -170,7 +170,7 @@ class Genode::Trace::Buffer
|
|||||||
if (entry.length() == 0)
|
if (entry.length() == 0)
|
||||||
return Entry(0);
|
return Entry(0);
|
||||||
|
|
||||||
addr_t const offset = (addr_t)entry._entry - (addr_t)_entries;
|
addr_t const offset = (addr_t)entry.data() - (addr_t)_entries;
|
||||||
if (offset + entry.length() + sizeof(_Entry) > _size)
|
if (offset + entry.length() + sizeof(_Entry) > _size)
|
||||||
return Entry(0);
|
return Entry(0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user