diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-03 01:47:32 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-03 01:47:34 -0400 |
commit | 37ee05f7c0f1fa8d94317e92795016e91f1bdfa6 (patch) | |
tree | 368407c3b64014409e0e742909b0de92cbae859a /src | |
parent | ccf0a9cb381cad75878c79b962ac61ded0466d08 (diff) |
submission_package: Ensure the 'extracted' member variable is always initialized
If an error occurs when constructing the PartitionFilesystem instance,
the constructor would be exited early, which wouldn't initialize the
extracted data member, making it possible for other code to perform an
uninitialized read by calling the public IsExtractedType() member
function. This prevents that.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/file_sys/submission_package.cpp | 2 | ||||
-rw-r--r-- | src/core/file_sys/submission_package.h | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index 5ebae1503..d39b79edd 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -61,8 +61,6 @@ NSP::NSP(VirtualFile file_) return; } - extracted = false; - SetTicketKeys(files); ReadNCAs(files); } diff --git a/src/core/file_sys/submission_package.h b/src/core/file_sys/submission_package.h index 297821522..da3dc5e9f 100644 --- a/src/core/file_sys/submission_package.h +++ b/src/core/file_sys/submission_package.h @@ -64,7 +64,7 @@ private: VirtualFile file; - bool extracted; + bool extracted = false; Loader::ResultStatus status; std::map<u64, Loader::ResultStatus> program_status; |