URL:
  <http://gna.org/bugs/?20458>

                 Summary: dbv_init() leaving uninitialized dbv uninitialized
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Mon 28 Jan 2013 01:34:41 AM EET
                Category: general
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: In Progress
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 

    _______________________________________________________

Details:

dbv_init() has a couple of fc_assert_ret()s in the beginning that check prior
dbv values to be proper pre-initialization values. (NULL and 0). Effectively
this means that dbv_init() can (and did in my case) return without
initializing the structure when completely uninitialized (any value) structure
is passed to it.

All older callers do the pre-initialization, but recently added
min_native_area check does not.

I think such a behavior from initialization function is dangerous and wrong,
so fix would be removing the assert and redundant pre-initializations from the
callers rather than adding pre-initialization to min_native_area case.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?20458>

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


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to