mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-03 07:20:00 +00:00
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.
This commit is contained in:
parent
02841052aa
commit
dade709f63
1 changed files with 6 additions and 3 deletions
|
@ -23,12 +23,15 @@ void SetTicketKeys(const std::vector<VirtualFile>& files) {
|
||||||
Core::Crypto::KeyManager keys;
|
Core::Crypto::KeyManager keys;
|
||||||
|
|
||||||
for (const auto& ticket_file : files) {
|
for (const auto& ticket_file : files) {
|
||||||
|
if (ticket_file == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ticket_file->GetExtension() != "tik") {
|
if (ticket_file->GetExtension() != "tik") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ticket_file == nullptr ||
|
if (ticket_file->GetSize() <
|
||||||
ticket_file->GetSize() <
|
|
||||||
Core::Crypto::TICKET_FILE_TITLEKEY_OFFSET + sizeof(Core::Crypto::Key128)) {
|
Core::Crypto::TICKET_FILE_TITLEKEY_OFFSET + sizeof(Core::Crypto::Key128)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue