URL:
  <http://gna.org/patch/?848>

                 Summary: min_constraint should be a 'valid' iterator
                 Project: Battle for Wesnoth
            Submitted by: microe
            Submitted on: Tuesday 11/13/2007 at 22:09
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

In the member function terrain_builder::build_terrains() there is an iterator
type named min_constraint. At declaration it is currently being set to the
special end() iterator. Which is deceiving. Main because if min_constraint is
never replaced with a constraint then at line 964, this iterator will be
accessed. If it is the end iterator then the access is undefined and the
compiled code may segfault.

The initial value of min_constraint should therefore be something that can be
accessed. In this patch, I just get the last iterator assuming that there is
always at least one valid value in the list. If this assumption is not valid,
let me know. I will try to work harder at finding a better initial value.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tuesday 11/13/2007 at 22:09  Name: min_constraint-should-be-valid 
Size: 595B   By: microe

<http://gna.org/patch/download.php?file_id=3200>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?848>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to