Skip to content

all games: Fix segfaults in CBaseEntity when VScript is disabled #1347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

copperpixel
Copy link
Contributor

@copperpixel copperpixel commented Jun 10, 2025

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant