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
         Discussion Lock: Any
        Operating System: None
         Planned Release: 



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:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to