[Freeciv-Dev] [bug #22083] apply_disaster() can reference city after it's freed

2014-06-02 Thread Jacob Nevins
Update of bug #22083 (project freeciv):

  Status:  Ready For Test = Fixed  
 Open/Closed:Open = Closed 


___

Reply to this item at:

  http://gna.org/bugs/?22083

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


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


[Freeciv-Dev] [bug #22083] apply_disaster() can reference city after it's freed

2014-05-31 Thread Jacob Nevins
Update of bug #22083 (project freeciv):

  Status: In Progress = Ready For Test 
  Depends on: = patch #4719

___

Follow-up Comment #3:

Patch written assuming patch #4719 gets committed first.
With that patch, this becomes less important on S2_5, but I plan to commit
there for the sake of keeping the code similar.

(file #20893, file #20894)
___

Additional Item Attachment:

File name: trunk-disaster-effect-rearrange.patch Size:4 KB
File name: S2_5-disaster-effect-rearrange.patch Size:3 KB


___

Reply to this item at:

  http://gna.org/bugs/?22083

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


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


[Freeciv-Dev] [bug #22083] apply_disaster() can reference city after it's freed

2014-05-25 Thread Jacob Nevins
URL:
  http://gna.org/bugs/?22083

 Summary: apply_disaster() can reference city after it's freed
 Project: Freeciv
Submitted by: jtn
Submitted on: Sun 25 May 2014 12:27:18 BST
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: S2_5 r24940
 Discussion Lock: Any
Operating System: Any
 Planned Release: 2.5.0, 2.6.0

___

Details:

I think that a disaster which has the ReducePopulation effect and some other
effect (such as 'Nuclear Accident' in the classic ruleset), if the city was
size 1 and thus destroyed, can cause pcity to be referenced after being freed.
(Untested.)

Disaster effects after ReducePopulation should check city_or_null (or possibly
pcity should become NULL) before doing their thing.

Also, disaster effects should be reordered. It's silly saying a building is
destroyed when the whole city is then lost. On the other hand,
pollution/fallout effects can sensibly occur simultaneously with city loss, so
should be moved before DE_REDUCE_POP.

(Having DE_REDUCE_POP able to destroy cities seems very fierce for a random
disaster. I'm inclined to add a similar disaster effect that can only reduce
population, not destroy a city. But that's a new ticket. Too late for 2.5?)




___

Reply to this item at:

  http://gna.org/bugs/?22083

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


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


[Freeciv-Dev] [bug #22083] apply_disaster() can reference city after it's freed

2014-05-25 Thread Jacob Nevins
Follow-up Comment #1, bug #22083 (project freeciv):

 I'm inclined to add a similar disaster effect that can only 
 reduce population, not destroy a city.
Wait, we can do that with reqs. Never mind.

___

Reply to this item at:

  http://gna.org/bugs/?22083

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


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


[Freeciv-Dev] [bug #22083] apply_disaster() can reference city after it's freed

2014-05-25 Thread Jacob Nevins
Follow-up Comment #2, bug #22083 (project freeciv):

 Having DE_REDUCE_POP able to destroy cities seems very fierce
Discussion of this tangent moved to new bug #22084.

___

Reply to this item at:

  http://gna.org/bugs/?22083

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


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


[Freeciv-Dev] [bug #22083] apply_disaster() can reference city after it's freed

2014-05-25 Thread Jacob Nevins
Update of bug #22083 (project freeciv):

  Status:None = In Progress
 Assigned to:None = jtn


___

Reply to this item at:

  http://gna.org/bugs/?22083

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


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