Skip to content

Commit

Permalink
Add missing nullptr check in handle_access_violation
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Aug 20, 2019
1 parent 8bd2ad8 commit 280385c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Utilities/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
// Hack: allocate memory in case the emulator is stopping
auto area = vm::reserve_map(vm::any, addr & -0x10000, 0x10000);

if (area->flags & 0x100)
if (!area || area->flags & 0x100)
{
// For 4kb pages
utils::memory_protect(vm::base(addr & -0x1000), 0x1000, utils::protection::rw);
Expand Down

0 comments on commit 280385c

Please sign in to comment.