[Commits] [wesnoth/wesnoth] 1316fc: fix a bug which could cause the terrain_builder to...
GitHub
noreply at github.com
Tue Jul 1 05:44:59 UTC 2014
Branch: refs/heads/master
Home: https://github.com/wesnoth/wesnoth
Commit: 1316fc13643cdde300d2becee6c37ab13729c86a
https://github.com/wesnoth/wesnoth/commit/1316fc13643cdde300d2becee6c37ab13729c86a
Author: Chris Beck <render787 at gmail.com>
Date: 2014-07-01 (Tue, 01 Jul 2014)
Changed paths:
M src/terrain_builder.cpp
Log Message:
-----------
fix a bug which could cause the terrain_builder to crash
The terrain builder logic assumes that the min_types list is
empty whenever the min_constraint pointer is null, and based on
this, dereferences the pointer. However, in subsequent passes of
the outer loop the pointer is initialized to null while the list
is not cleared. According to coverity this can actually cause
a null pointer dereference in explicit cases.
We fix it by explicitly re-initializing the list on each pass.
More information about the Commits
mailing list