Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] Re: No check for player!=NULL in player.c diplomatic state
Home

[Freeciv-Dev] Re: No check for player!=NULL in player.c diplomatic state

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Egor Vyscrebentsov <evyscr@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: No check for player!=NULL in player.c diplomatic state functions
From: Jason Dorje Short <jdorje@xxxxxxxxx>
Date: Wed, 12 Jul 2006 16:58:04 -0400

Egor Vyscrebentsov wrote:
Good daytime!

common/player.c:pplayers_at_war() does not check players to be not
NULLed. (pplayer_get_diplstate(), other pplayers_*()
diplomatic state functions and gives_shared_vision don't check too.)

I'm not sure this is a bug, because NULLed player should not be passed
as argument. But what about assert for this case?

A dereference is just as good as an assert. It will crash if a NULL value is passed in.

-jason



[Prev in Thread] Current Thread [Next in Thread]