mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-12 23:54:35 +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
|
class OptionMenuItemCommand : OptionMenuItemSubmenu
|
||||||
{
|
{
|
||||||
|
private String ccmd; // do not allow access to this from the outside.
|
||||||
|
|
||||||
OptionMenuItemCommand Init(String label, Name command, bool centered = false)
|
OptionMenuItemCommand Init(String label, Name command, bool centered = false)
|
||||||
{
|
{
|
||||||
Super.Init(label, command, 0, centered);
|
Super.Init(label, command, 0, centered);
|
||||||
|
ccmd = command;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +149,7 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
|
||||||
if (m.GetItem(mAction) != self) return false;
|
if (m.GetItem(mAction) != self) return false;
|
||||||
}
|
}
|
||||||
Menu.MenuSound("menu/choose");
|
Menu.MenuSound("menu/choose");
|
||||||
DoCommand(mAction);
|
DoCommand(ccmd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue