From 1de27c54f1e576d5b09a0dd6a3cc04641c427ec7 Mon Sep 17 00:00:00 2001 From: Duckbill Date: Sat, 13 Jan 2018 16:02:54 +0300 Subject: [PATCH] Fix range checks --- sysmodules/rosalina/source/menus/cheats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysmodules/rosalina/source/menus/cheats.c b/sysmodules/rosalina/source/menus/cheats.c index c7cf0c4..3fbe273 100644 --- a/sysmodules/rosalina/source/menus/cheats.c +++ b/sysmodules/rosalina/source/menus/cheats.c @@ -120,11 +120,11 @@ char failureReason[64]; static bool Cheat_IsValidAddress(u32 address, u32 size) { - if (codeStartAddress <= address && address <= codeStartAddress + codeTotalSize - size) + if (codeStartAddress > 0 && codeStartAddress <= address && address <= codeStartAddress + codeTotalSize - size) { return true; } - if (heapStartAddress <= address && address <= heapStartAddress + heapTotalSize - size) + if (heapStartAddress > 0 && heapStartAddress <= address && address <= heapStartAddress + heapTotalSize - size) { return true; }