diff options
author | ScureX <47725553+ScureX@users.noreply.github.com> | 2022-12-05 19:16:16 +0100 |
---|---|---|
committer | ScureX <47725553+ScureX@users.noreply.github.com> | 2022-12-05 19:16:16 +0100 |
commit | b71a63e32beabec1d91029f88527c3462c80d758 (patch) | |
tree | 2ab8686b1b06c4550f26d6a942f0596caf6c17c3 /Northstar.CustomServers/mod/scripts/vscripts | |
parent | a4606ba8c3c6d816499ab73b6633dd1f33728adb (diff) | |
download | NorthstarMods-b71a63e32beabec1d91029f88527c3462c80d758.tar.gz NorthstarMods-b71a63e32beabec1d91029f88527c3462c80d758.zip |
Fix calling `TitanEject` without arguments crashing server (#538)v1.11.0-rc1
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/titan/class_titan.gnut | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/titan/class_titan.gnut b/Northstar.CustomServers/mod/scripts/vscripts/titan/class_titan.gnut index 5f72385e..d0a2d5e4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/titan/class_titan.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/titan/class_titan.gnut @@ -68,6 +68,11 @@ bool function ClientCommand_TitanEject( entity player, array<string> args ) if ( !PlayerCanEject( player ) ) return true + // check array length before accessing index to avoid oob access + // prevents crashing a server by just calling `TitanEject` without arguments + if( args.len() < 1 ) + return true + int ejectPressCount = args[ 0 ].tointeger() if ( ejectPressCount < 3 ) return true |