Delete x_Xbe if it isn't needed after checking signature

This also changes the order of operations for the sigchk if statement.
This commit is contained in:
wutno 2019-01-07 12:44:33 -05:00 committed by GitHub
parent 80dcbf436e
commit a08f22121e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1991,14 +1991,22 @@ void WndMain::OpenXbe(const char *x_filename)
return;
}
if (!m_Xbe->CheckXbeSignature() && !g_Settings->m_core.allowAdminPrivilege)
if (!g_Settings->m_core.allowAdminPrivilege && !m_Xbe->CheckXbeSignature())
{
int ret = MessageBox(m_hwnd, "XBE signature check failed!\n"
"\nThis is dangerous, as maliciously modified Xbox titles could take control of your system.\n"
"\nAre you sure you want to continue?", "Cxbx-Reloaded", MB_ICONEXCLAMATION | MB_YESNO);
if (ret != IDYES)
{
delete m_Xbe; m_Xbe = nullptr;
RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE);
UpdateCaption();
return;
}
}
// save this xbe to the list of recent xbe files
if(m_XbeFilename[0] != '\0') {