From 18d8fad098f0ab9fad9d0dacc1f08a6f3e4c4897 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 24 Jul 2015 23:50:02 -0500 Subject: [PATCH] Couple of fixes for IO (null pointer deref and improper XctdCompressionInformation) --- src/xenia/kernel/xboxkrnl_io.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl_io.cc index a275d559d..3d4434713 100644 --- a/src/xenia/kernel/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl_io.cc @@ -433,6 +433,7 @@ dword_result_t NtQueryInformationFile( assert_true(length == 4); // This is wrong and puts files into wrong states for games that use // XctdDecompression. + /* uint32_t magic; size_t bytes_read; size_t cur_pos = file->position(); @@ -450,6 +451,9 @@ dword_result_t NtQueryInformationFile( } file->set_position(cur_pos); info = 4; + */ + result = X_STATUS_UNSUCCESSFUL; + info = 0; } break; case XFileSectorInformation: @@ -611,7 +615,8 @@ dword_result_t NtQueryDirectoryFile( uint32_t info = 0; auto file = kernel_state()->object_table()->LookupObject(file_handle); - auto name = file_name->to_string(kernel_memory()->virtual_membase()); + auto name = + file_name ? file_name->to_string(kernel_memory()->virtual_membase()) : ""; if (file) { X_FILE_DIRECTORY_INFORMATION dir_info = {0}; result = file->QueryDirectory(