diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-10-02 23:10:24 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-10-02 23:16:05 -0400 |
| commit | d91cd1d6389de9eaed61bc459a759d84447f7291 (patch) | |
| tree | fd914897b31899442183b7d648f65dbdcb9b3ab4 /src/core/file_sys | |
| parent | bc5dde276571f0dceebeb2e567729a6fb9f0bab0 (diff) | |
card_image: Ensure program_nca_status is always initialized
If any of the error paths before the NCA retrieval are taken, it'll
result in program_nca_status being left in an inconsistent state. So we
initialize it by default with a value indicating an error.
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index edfc1bbd47..8f5142a070 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp @@ -20,7 +20,9 @@ namespace FileSys { constexpr std::array<const char*, 0x4> partition_names = {"update", "normal", "secure", "logo"}; -XCI::XCI(VirtualFile file_) : file(std::move(file_)), partitions(0x4) { +XCI::XCI(VirtualFile file_) + : file(std::move(file_)), program_nca_status{Loader::ResultStatus::ErrorXCIMissingProgramNCA}, + partitions(0x4) { if (file->ReadObject(&header) != sizeof(GamecardHeader)) { status = Loader::ResultStatus::ErrorBadXCIHeader; return; |
