mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
Kernel: Make Region weakable and use WeakPtr<Region> instead of Region*
This turns use-after-free bugs into null pointer dereferences instead.
This commit is contained in:
@@ -273,7 +273,7 @@ Region* Process::region_from_range(const Range& range)
|
||||
for (auto& region : m_regions) {
|
||||
if (region.vaddr() == range.base() && region.size() == size) {
|
||||
m_region_lookup_cache.range = range;
|
||||
m_region_lookup_cache.region = ®ion;
|
||||
m_region_lookup_cache.region = region.make_weak_ptr();
|
||||
return ®ion;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user