Summary: dbv_init() leaving uninitialized dbv uninitialized
Submitted by: cazfi
Submitted on: Mon 28 Jan 2013 01:34:41 AM EET
Severity: 3 - Normal
Priority: 5 - Normal
Status: In Progress
Assigned to: None
Discussion Lock: Any
Operating System: None
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