Ticket #43206

Nonsafe unit_list_iterate() used when unit may escape

Open Date: 2021-11-13 21:14 Last Update: 2021-11-28 00:19

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

When handling unit escape, potential units are iterated with iterate_unit_list(ptile->units). If the unit does escape, it will leave the ptile->units list. Bad things can happen when iterating over a list that changes during the iteration. In this case it most likely causes later units in the original tile not to be considered for escaping at all, though a server crash is not impossible.

This should use iterate_unit_list_safe()

Ticket History (3/4 Histories)

2021-11-13 21:14 Updated by: cazfi
  • New Ticket "Nonsafe unit_list_iterate() used when unit may escape" created
2021-11-13 21:20 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.0 (closed)
2021-11-28 00:19 Updated by: cazfi
  • Status Update from Open to Closed
  • Owner Update from (None) to cazfi
  • Resolution Update from Accepted to Fixed

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login