[Commits] [wesnoth/wesnoth] d827a3: Fixup 19bbfed again (fixs bug #1941)

GitHub noreply at github.com
Mon Sep 4 14:37:36 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: d827a326e16e62c6dfce90ac8378831f2897f62a
      https://github.com/wesnoth/wesnoth/commit/d827a326e16e62c6dfce90ac8378831f2897f62a
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-09-05 (Tue, 05 Sep 2017)

  Changed paths:
    M src/ai/default/attack.cpp

  Log Message:
  -----------
  Fixup 19bbfed again (fixs bug #1941)

TO quote @jyrkive: "prev_def is a pointer to the defendant after the previous fight. The defendant belongs
to bc, it's assigned here. And now when bc is a smart pointer, it frees the battle_context when it goes out
of scope, i.e. when the loop iteration changes. In the next iteration, the stale prev_def is accessed before
a new battle_context is created: use-after-free."





More information about the Commits mailing list