aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
authorScureX <47725553+ScureX@users.noreply.github.com>2022-12-05 19:16:16 +0100
committerScureX <47725553+ScureX@users.noreply.github.com>2022-12-05 19:16:16 +0100
commitb71a63e32beabec1d91029f88527c3462c80d758 (patch)
tree2ab8686b1b06c4550f26d6a942f0596caf6c17c3 /Northstar.CustomServers/mod/scripts/vscripts
parenta4606ba8c3c6d816499ab73b6633dd1f33728adb (diff)
downloadNorthstarMods-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.gnut5
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 5f72385ea..d0a2d5e4c 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