Skip to content

Commit

Permalink
Make sure pointer is valid before using it.
Browse files Browse the repository at this point in the history
refs ticket:2171

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/2.3@11698 4a71c877-e1ca-e34f-864e-861f7616d084
  • Loading branch information
buginator authored and Git SVN Gateway committed Sep 20, 2010
1 parent d20fe58 commit 4853171
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/structure.c
Expand Up @@ -6654,6 +6654,9 @@ void hqReward(UBYTE losingPlayer, UBYTE rewardPlayer)
//
BOOL StructIsFactory(STRUCTURE *Struct)
{
ASSERT_OR_RETURN(false, Struct != NULL, "Invalid structure!");
ASSERT_OR_RETURN(false, Struct->pStructureType != NULL, "Invalid structureType!");

if( (Struct->pStructureType->type == REF_FACTORY) ||
(Struct->pStructureType->type == REF_CYBORG_FACTORY) ||
(Struct->pStructureType->type == REF_VTOL_FACTORY) )
Expand Down

0 comments on commit 4853171

Please sign in to comment.