aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-10-02 23:10:24 -0400
committerLioncash <mathew1800@gmail.com>2018-10-02 23:16:05 -0400
commitd91cd1d6389de9eaed61bc459a759d84447f7291 (patch)
treefd914897b31899442183b7d648f65dbdcb9b3ab4 /src/core/file_sys
parentbc5dde276571f0dceebeb2e567729a6fb9f0bab0 (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.cpp4
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;