From 26e09474a95cfec1cdf718c033b80baf819e6f8f Mon Sep 17 00:00:00 2001 From: jduncanator Date: Mon, 19 Nov 2018 11:20:17 +1100 Subject: [PATCH] ContentServices: Handle null LocationEntry Path in VerifyContentType (#506) When `LocationEntry.ContentPath` is `null`, we can always return `false` as it can't possibly be a valid `ContentType` --- Ryujinx.HLE/FileSystem/Content/ContentManager.cs | 5 +++++ Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs index 025eb2619..3727841dd 100644 --- a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs +++ b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs @@ -223,6 +223,11 @@ namespace Ryujinx.HLE.FileSystem.Content private bool VerifyContentType(LocationEntry LocationEntry, ContentType ContentType) { + if (LocationEntry.ContentPath == null) + { + return false; + } + StorageId StorageId = LocationHelper.GetStorageId(LocationEntry.ContentPath); string InstalledPath = Device.FileSystem.SwitchPathToSystemPath(LocationEntry.ContentPath); diff --git a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index 6bb2847f1..bde6f69f2 100644 --- a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -78,6 +78,7 @@ namespace Ryujinx.HLE.FileSystem { return null; } + return GetFullPath(MakeDirAndGetFullPath(Parts[0]), Parts[1]); }