aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-04-05 18:18:41 -0700
committerGitHub <noreply@github.com>2022-04-05 18:18:41 -0700
commit4e3136128e17b7b2d6397a10894d074ef35b7e6c (patch)
treeb794be8017f0904ce16b695ad4102e975fe17492 /src
parent2992924e849c715eb47b2bd9941003220f180fd2 (diff)
parente144d064afb21d2e230e79af72a03bd39511be87 (diff)
Merge pull request #8100 from Morph1984/registered-crash
registered_cache: Prevent nullptr dereference when accumulating files
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/registered_cache.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index 7a646b5f1c..4ada4a69bf 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -387,15 +387,17 @@ std::vector<NcaID> RegisteredCache::AccumulateFiles() const {
continue;
for (const auto& nca_dir : d2_dir->GetSubdirectories()) {
- if (!FollowsNcaIdFormat(nca_dir->GetName()))
+ if (nca_dir == nullptr || !FollowsNcaIdFormat(nca_dir->GetName())) {
continue;
+ }
ids.push_back(Common::HexStringToArray<0x10, true>(nca_dir->GetName().substr(0, 0x20)));
}
for (const auto& nca_file : d2_dir->GetFiles()) {
- if (!FollowsNcaIdFormat(nca_file->GetName()))
+ if (nca_file == nullptr || !FollowsNcaIdFormat(nca_file->GetName())) {
continue;
+ }
ids.push_back(
Common::HexStringToArray<0x10, true>(nca_file->GetName().substr(0, 0x20)));