Browse Source
Merge pull request #8100 from Morph1984/registered-crash
registered_cache: Prevent nullptr dereference when accumulating files
pull/15/merge
bunnei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
src/core/file_sys/registered_cache.cpp
|
|
@ -387,15 +387,17 @@ std::vector<NcaID> RegisteredCache::AccumulateFiles() const { |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
|
for (const auto& nca_dir : d2_dir->GetSubdirectories()) { |
|
|
for (const auto& nca_dir : d2_dir->GetSubdirectories()) { |
|
|
if (!FollowsNcaIdFormat(nca_dir->GetName())) |
|
|
|
|
|
|
|
|
if (nca_dir == nullptr || !FollowsNcaIdFormat(nca_dir->GetName())) { |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ids.push_back(Common::HexStringToArray<0x10, true>(nca_dir->GetName().substr(0, 0x20))); |
|
|
ids.push_back(Common::HexStringToArray<0x10, true>(nca_dir->GetName().substr(0, 0x20))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for (const auto& nca_file : d2_dir->GetFiles()) { |
|
|
for (const auto& nca_file : d2_dir->GetFiles()) { |
|
|
if (!FollowsNcaIdFormat(nca_file->GetName())) |
|
|
|
|
|
|
|
|
if (nca_file == nullptr || !FollowsNcaIdFormat(nca_file->GetName())) { |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ids.push_back( |
|
|
ids.push_back( |
|
|
Common::HexStringToArray<0x10, true>(nca_file->GetName().substr(0, 0x20))); |
|
|
Common::HexStringToArray<0x10, true>(nca_file->GetName().substr(0, 0x20))); |
|
|
|