Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Generals/Code/GameEngine/Source/Common/Thing/Thing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ void Thing::setPositionZ( Real z )
//=============================================================================
void Thing::setPosition( const Coord3D *pos )
{
// Validate position pointer to prevent null pointer dereference
if( pos == NULL )
{
DEBUG_CRASH(( "Thing::setPosition called with NULL position pointer" ));
return;
}

//USE_PERF_TIMER(ThingMatrixStuff)
if( !m_template->isKindOf( KINDOF_STICK_TO_TERRAIN_SLOPE) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ void SpecialPowerModule::triggerSpecialPower( const Coord3D *location )
//-------------------------------------------------------------------------------------------------
void SpecialPowerModule::createViewObject( const Coord3D *location )
{
// Validate location pointer to prevent null pointer dereference
if( location == NULL )
return;

const SpecialPowerModuleData *modData = getSpecialPowerModuleData();
const SpecialPowerTemplate *powerTemplate = modData->m_specialPowerTemplate;

Expand Down
7 changes: 7 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/Thing/Thing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ void Thing::setPositionZ( Real z )
//=============================================================================
void Thing::setPosition( const Coord3D *pos )
{
// Validate position pointer to prevent null pointer dereference
if( pos == NULL )
{
DEBUG_CRASH(( "Thing::setPosition called with NULL position pointer" ));
return;
}

//USE_PERF_TIMER(ThingMatrixStuff)
if( !m_template->isKindOf( KINDOF_STICK_TO_TERRAIN_SLOPE) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ void SpecialPowerModule::triggerSpecialPower( const Coord3D *location )
//-------------------------------------------------------------------------------------------------
void SpecialPowerModule::createViewObject( const Coord3D *location )
{
// Validate location pointer to prevent null pointer dereference
if( location == NULL )
return;

const SpecialPowerModuleData *modData = getSpecialPowerModuleData();
const SpecialPowerTemplate *powerTemplate = modData->m_specialPowerTemplate;

Expand Down
Loading