Skip to content

Fix rare crash bug in SDKTools GetGameRulesProxyEnt#1089

Merged
KyleSanderson merged 1 commit intoalliedmodders:masterfrom
BotoX:bugfix-sdktools-gamerules
Nov 6, 2019
Merged

Fix rare crash bug in SDKTools GetGameRulesProxyEnt#1089
KyleSanderson merged 1 commit intoalliedmodders:masterfrom
BotoX:bugfix-sdktools-gamerules

Conversation

@BotoX
Copy link
Contributor

@BotoX BotoX commented Sep 26, 2019

https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/ServerNetworkProperty.cpp#L157

ServerClass* CServerNetworkProperty::GetServerClass()
{
	if ( !m_pServerClass )
		m_pServerClass = m_pOuter->GetServerClass();
	return m_pServerClass;
}

m_pOuter can be NULL and then GetServerClass would crash
so check m_pOuter first with GetEntityHandle:

IHandleEntity *CServerNetworkProperty::GetEntityHandle( )
{
	return m_pOuter;
}

https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/ServerNetworkProperty.cpp#L103

Using GameRules_SetProp would sometimes crash for us, after this fix it hasn't crashed for 2 weeks and it doesn't look wrong to check this either.

@KyleSanderson KyleSanderson merged commit 3dd1e5a into alliedmodders:master Nov 6, 2019
@KyleSanderson
Copy link
Member

Sorry man - thank you very much for the patch and crash fix.

@Kenzzer Kenzzer mentioned this pull request Jan 9, 2023
6 tasks
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.

2 participants