Fix null deref.

This commit is contained in:
Ben Vanik 2015-02-12 18:11:29 -08:00
parent d22bfec53c
commit f8c7c97d54
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ X_STATUS NtCreateFile(PPCContext* ppc_state, KernelState* state,
if (creation_disposition != FileDisposition::X_FILE_OPEN || if (creation_disposition != FileDisposition::X_FILE_OPEN ||
desired_access & FileAccess::X_GENERIC_WRITE || desired_access & FileAccess::X_GENERIC_WRITE ||
desired_access & FileAccess::X_GENERIC_ALL) { desired_access & FileAccess::X_GENERIC_ALL) {
if (entry->is_read_only()) { if (entry && entry->is_read_only()) {
// We don't support any write modes. // We don't support any write modes.
XELOGW("Attempted to open the file/dir for create/write"); XELOGW("Attempted to open the file/dir for create/write");
desired_access = FileAccess::X_GENERIC_READ; desired_access = FileAccess::X_GENERIC_READ;