mirror of
https://github.com/seL4/seL4.git
synced 2026-04-09 08:49:54 +00:00
machine/capdl.c: fix memory corruption
This fixes memory corruption in `add_to_seen()` when watermark equals to array length. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
committed by
Gerwin Klein
parent
8b298285dc
commit
7c3bc020fa
@@ -29,7 +29,7 @@ int watermark = 0;
|
||||
void add_to_seen(cap_t c)
|
||||
{
|
||||
/* Won't work well if there're more than SEEN_SZ cnode */
|
||||
if (watermark <= SEEN_SZ) {
|
||||
if (watermark < SEEN_SZ) {
|
||||
seen_list[watermark] = c;
|
||||
watermark++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user