diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-10-03 02:06:26 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-10-03 02:06:30 -0400 |
| commit | 689010c2fa94e856f989b08e082713e0ce50ec86 (patch) | |
| tree | 87354e6c2e7c117eebdc762f7d8976991b7ad0a4 /src/core/file_sys | |
| parent | b77f6a32ff1957f88bcb521323aef62efb13d87a (diff) | |
submission_package: Correct location of null check within SetTicketKeys()
If a ticket file was ever a null pointer, we'd cause a null pointer
dereference, as we were calling GetExtension() on the pointer instance.
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/submission_package.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index c3848e826f..829aca06f8 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -23,13 +23,16 @@ void SetTicketKeys(const std::vector<VirtualFile>& files) { Core::Crypto::KeyManager keys; for (const auto& ticket_file : files) { + if (ticket_file == nullptr) { + continue; + } + if (ticket_file->GetExtension() != "tik") { continue; } - if (ticket_file == nullptr || - ticket_file->GetSize() < - Core::Crypto::TICKET_FILE_TITLEKEY_OFFSET + sizeof(Core::Crypto::Key128)) { + if (ticket_file->GetSize() < + Core::Crypto::TICKET_FILE_TITLEKEY_OFFSET + sizeof(Core::Crypto::Key128)) { continue; } |
