mirror of
https://github.com/citra-emu/citra-nightly.git
synced 2024-12-25 21:15:39 +00:00
svc: Correct vma_map boundary check within QueryProcessMemory
This should be using the process instance retrieved within the function, and not g_current_process, otherwise this is potentially comparing iterators from unrelated vma_map instances (which is undefined behavior).
This commit is contained in:
parent
57ce5079bc
commit
930abb4b5e
|
@ -923,7 +923,7 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* page_inf
|
||||||
|
|
||||||
auto vma = process->vm_manager.FindVMA(addr);
|
auto vma = process->vm_manager.FindVMA(addr);
|
||||||
|
|
||||||
if (vma == g_current_process->vm_manager.vma_map.end())
|
if (vma == process->vm_manager.vma_map.end())
|
||||||
return ERR_INVALID_ADDRESS;
|
return ERR_INVALID_ADDRESS;
|
||||||
|
|
||||||
memory_info->base_address = vma->second.base;
|
memory_info->base_address = vma->second.base;
|
||||||
|
|
Loading…
Reference in a new issue