Merge pull request #2855 from Lazy-Coder-03/kern_continue_debug_event_fix
kern: only check thread ids pointer when count is nonzero
This commit is contained in:
@@ -141,11 +141,10 @@ namespace ams::kern::svc {
|
|||||||
/* Verify that the number of thread ids is valid. */
|
/* Verify that the number of thread ids is valid. */
|
||||||
R_UNLESS((0 <= num_thread_ids && num_thread_ids <= MaximumDebuggableThreadCount), svc::ResultOutOfRange());
|
R_UNLESS((0 <= num_thread_ids && num_thread_ids <= MaximumDebuggableThreadCount), svc::ResultOutOfRange());
|
||||||
|
|
||||||
R_UNLESS(GetCurrentProcess().GetPageTable().IsSafeUserPointer(KProcessAddress(user_thread_ids.GetUnsafePointer()), num_thread_ids * sizeof(uint64_t)), svc::ResultInvalidPointer());
|
|
||||||
|
|
||||||
/* Copy the threads from userspace. */
|
/* Copy the threads from userspace. */
|
||||||
uint64_t thread_ids[MaximumDebuggableThreadCount];
|
uint64_t thread_ids[MaximumDebuggableThreadCount];
|
||||||
if (num_thread_ids > 0) {
|
if (num_thread_ids > 0) {
|
||||||
|
R_UNLESS(GetCurrentProcess().GetPageTable().IsSafeUserPointer(KProcessAddress(user_thread_ids.GetUnsafePointer()), num_thread_ids * sizeof(uint64_t)), svc::ResultInvalidPointer());
|
||||||
R_TRY(user_thread_ids.CopyArrayTo(thread_ids, num_thread_ids));
|
R_TRY(user_thread_ids.CopyArrayTo(thread_ids, num_thread_ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user