1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-22 20:06:40 +00:00

kern: add missing debug mode check to WriteDebugProcessMemory

This commit is contained in:
Michael Scire 2022-01-03 08:59:27 -08:00
parent 30fac905af
commit 275da52305

View file

@ -277,6 +277,9 @@ namespace ams::kern::svc {
}
Result WriteDebugProcessMemory(ams::svc::Handle debug_handle, uintptr_t buffer, uintptr_t address, size_t size) {
/* Only allow invoking the svc on development hardware. */
R_UNLESS(KTargetSystem::IsDebugMode(), svc::ResultNotImplemented());
/* Validate address / size. */
R_UNLESS(size > 0, svc::ResultInvalidSize());
R_UNLESS((address < address + size), svc::ResultInvalidCurrentMemory());