Browse Source
Merge pull request #1895 from lioncash/uninit
patch_manager: Prevent use of a dangling pointer within PatchRomFS
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
4 deletions
-
src/core/file_sys/patch_manager.cpp
|
|
|
@ -286,13 +286,12 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t |
|
|
|
VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, ContentRecordType type, |
|
|
|
VirtualFile update_raw) const { |
|
|
|
const auto log_string = fmt::format("Patching RomFS for title_id={:016X}, type={:02X}", |
|
|
|
title_id, static_cast<u8>(type)) |
|
|
|
.c_str(); |
|
|
|
title_id, static_cast<u8>(type)); |
|
|
|
|
|
|
|
if (type == ContentRecordType::Program || type == ContentRecordType::Data) |
|
|
|
LOG_INFO(Loader, log_string); |
|
|
|
LOG_INFO(Loader, "{}", log_string); |
|
|
|
else |
|
|
|
LOG_DEBUG(Loader, log_string); |
|
|
|
LOG_DEBUG(Loader, "{}", log_string); |
|
|
|
|
|
|
|
if (romfs == nullptr) |
|
|
|
return romfs; |
|
|
|
|