[Commits] [wesnoth/wesnoth] 30e010: fix a bug which could cause the terrain_builder to...

GitHub noreply at github.com
Tue Jul 1 05:48:41 UTC 2014


  Branch: refs/heads/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 30e0106ebfadc300b8af69e0635437ca3a178912
      https://github.com/wesnoth/wesnoth/commit/30e0106ebfadc300b8af69e0635437ca3a178912
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M src/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