mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
SharedBuffer: fix nullptr dereference on seal
If the buffer hadn't been used by all participants yet, there wouldn't be a region, which leads to bad things.
This commit is contained in:
parent
7bf420d83d
commit
d53e54f8bf
1 changed files with 4 additions and 2 deletions
|
@ -2479,8 +2479,10 @@ public:
|
|||
LOCKER(m_refs.lock());
|
||||
m_writable = false;
|
||||
for (auto& ref : m_refs.resource()) {
|
||||
ref.region->set_writable(false);
|
||||
MM.remap_region(*ref.region->page_directory(), *ref.region);
|
||||
if (ref.region) {
|
||||
ref.region->set_writable(false);
|
||||
MM.remap_region(*ref.region->page_directory(), *ref.region);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue