source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

all games: Fix segfaults in CBaseEntity when VScript is disabled

Open copperpixel opened this issue 6 months ago • 0 comments

Description

When VScript is disabled using the -noscripting commandline param or when an invalid scripting language is specified, the VScript VM doesn't get initialized which shouldn't be fatal. However the server will attempt to dereference a NULL g_pScriptVM pointer due to missing checks in CBaseEntity::RunVScripts, CBaseEntity::RunPrecacheScripts and CBaseEntity::RunOnPostSpawnScripts leading to a server crash on map load if there are any entities with scripts assigned to them.

The fix for this is to make the functions return early if ValidateScriptScope fails.

Closes:

  • https://github.com/ValveSoftware/Source-1-Games/issues/5122

copperpixel avatar Jun 10 '25 16:06 copperpixel