Permalink
Browse files

Delete x_Xbe if it isn't needed after checking signature

This also changes the order of operations for the sigchk if statement.
  • Loading branch information...
GXTX committed Jan 7, 2019
1 parent 80dcbf4 commit a08f22121e76064f02a8fe711b15a3f0f163e6ec
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/gui/WndMain.cpp
@@ -1991,13 +1991,21 @@ 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

0 comments on commit a08f221

Please sign in to comment.