mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- do not allow outside access to the variable storing the CCMD for OptionMenuItemCommand.
This can be abused to execute atbitrary commands from inside script code.
This commit is contained in:
parent
6b42036eb6
commit
f3ac82e112
1 changed files with 4 additions and 1 deletions
|
@ -126,9 +126,12 @@ class OptionMenuItemSubmenu : OptionMenuItem
|
|||
|
||||
class OptionMenuItemCommand : OptionMenuItemSubmenu
|
||||
{
|
||||
private String ccmd; // do not allow access to this from the outside.
|
||||
|
||||
OptionMenuItemCommand Init(String label, Name command, bool centered = false)
|
||||
{
|
||||
Super.Init(label, command, 0, centered);
|
||||
ccmd = command;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -146,7 +149,7 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
|
|||
if (m.GetItem(mAction) != self) return false;
|
||||
}
|
||||
Menu.MenuSound("menu/choose");
|
||||
DoCommand(mAction);
|
||||
DoCommand(ccmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue