bugFreeciv - Bugs: bug #20458, dbv_init() leaving uninitialized...

 
 
Show feedback again

bug #20458: dbv_init() leaving uninitialized dbv uninitialized

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Sun 27 Jan 2013 11:34:41 PM UTC  
 
Category: generalSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: Operating System: None
Planned Release: 2.3.4, 2.4.0, 2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 29 Jan 2013 10:13:32 PM UTC, SVN revision 22233:

Fixed dbv_init() to work when structure members are completely
uninitialized, i.e., possibly something else than zeroes and NULLs
by removing fc_assert_ret()s from the beginning.

See gna bug #20458

(Browse SVN revision 22233)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 29 Jan 2013 10:13:28 PM UTC, SVN revision 22232:

Fixed dbv_init() to work when structure members are completely
uninitialized, i.e., possibly something else than zeroes and NULLs
by removing fc_assert_ret()s from the beginning.

See gna bug #20458

(Browse SVN revision 22232)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 29 Jan 2013 10:13:23 PM UTC, SVN revision 22231:

Fixed dbv_init() to work when structure members are completely
uninitialized, i.e., possibly something else than zeroes and NULLs
by removing fc_assert_ret()s from the beginning.

See gna bug #20458

(Browse SVN revision 22231)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 27 Jan 2013 11:37:28 PM UTC, comment #1:

Patch

(file #17031)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 27 Jan 2013 11:34:41 PM UTC, original submission:

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.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17031:  DbvInitUninit.patch added by cazfi (2kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 29 Jan 2013 10:13:53 PM UTCcazfiStatusReady For Test=>Fixed
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Sun 27 Jan 2013 11:37:28 PM UTCcazfiAttached File-=>Added DbvInitUninit.patch, #17031
      StatusIn Progress=>Ready For Test
      Planned Release=>2.3.4, 2.4.0, 2.5.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup