- fixed permission validation in OptionMenuItemCommand.DoCommand.

This was missing the InMenu check like the other critical menu functions.
This commit is contained in:
Christoph Oelckers 2021-06-07 08:16:53 +02:00
parent dc7ba3778d
commit b3fd8ce12a

View file

@ -964,10 +964,16 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, UnbindACommand)
// This is only accessible to the special menu item to run CCMDs. // This is only accessible to the special menu item to run CCMDs.
DEFINE_ACTION_FUNCTION(DOptionMenuItemCommand, DoCommand) DEFINE_ACTION_FUNCTION(DOptionMenuItemCommand, DoCommand)
{ {
if (CurrentMenu == nullptr) return 0;
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(cmd); PARAM_STRING(cmd);
PARAM_BOOL(unsafe); PARAM_BOOL(unsafe);
// Only menus are allowed to execute CCMDs.
if (DMenu::InMenu == 0)
{
I_FatalError("Attempt to execute CCMD '%s' outside of menu code", cmd.GetChars());
}
UnsafeExecutionScope scope(unsafe); UnsafeExecutionScope scope(unsafe);
C_DoCommand(cmd); C_DoCommand(cmd);
return 0; return 0;