From 4abd958c18fb9d906c8f1015aeea9efe9c984be1 Mon Sep 17 00:00:00 2001 From: emoose Date: Sat, 4 Jan 2020 20:14:16 +0000 Subject: [PATCH] [XMP] Add extra checks from XAM to help prevent dash host crash --- src/xenia/kernel/xam/apps/xmp_app.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xenia/kernel/xam/apps/xmp_app.cc b/src/xenia/kernel/xam/apps/xmp_app.cc index ec02f6acf..e60fd4645 100644 --- a/src/xenia/kernel/xam/apps/xmp_app.cc +++ b/src/xenia/kernel/xam/apps/xmp_app.cc @@ -351,8 +351,16 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr, } case 0x00070013: { assert_true(!buffer_length || buffer_length == 8); + if (!buffer) { + return X_E_INVALIDARG; + } uint32_t xmp_client = xe::load_and_swap(buffer + 0); uint32_t storage_ptr = xe::load_and_swap(buffer + 4); + if (!storage_ptr) { + // dash seems to call this with empty storage_ptr, XAM returns this + // error: + return X_E_INVALIDARG; + } uint32_t playlist_handle = xe::load_and_swap(memory_->TranslateVirtual(storage_ptr)); assert_true(xmp_client == 0x00000002);