aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorScureX <47725553+ScureX@users.noreply.github.com>2022-12-05 19:16:16 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-12-05 19:19:06 +0100
commit90f11e5adeb6e3eda5067759c667b579a2b111cc (patch)
tree564e948615239638a9d8a9ed3aebc815f429f828 /Northstar.CustomServers/mod/scripts
parent0a5c705f662773ecb97a9b06d2c92e023307b441 (diff)
downloadNorthstarMods-90f11e5adeb6e3eda5067759c667b579a2b111cc.tar.gz
NorthstarMods-90f11e5adeb6e3eda5067759c667b579a2b111cc.zip
Fix calling `TitanEject` without arguments crashing server (#538)v1.10.9-rc1v1.10.91.10.X
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-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 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