summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/submission_package.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/file_sys/submission_package.cpp')
-rw-r--r--src/core/file_sys/submission_package.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp
index 730221fd6..ef3084681 100644
--- a/src/core/file_sys/submission_package.cpp
+++ b/src/core/file_sys/submission_package.cpp
@@ -248,7 +248,8 @@ void NSP::InitializeExeFSAndRomFS(const std::vector<VirtualFile>& files) {
void NSP::ReadNCAs(const std::vector<VirtualFile>& files) {
for (const auto& outer_file : files) {
- if (outer_file->GetName().substr(outer_file->GetName().size() - 9) != ".cnmt.nca") {
+ if (outer_file->GetName().size() < 9 ||
+ outer_file->GetName().substr(outer_file->GetName().size() - 9) != ".cnmt.nca") {
continue;
}