Reply To mortmann
and the following statement is always TRUE and can therefore be removed:
More than that, the entire real_activities array can be removed now that there's no non-real activities (holes) in the activities enum. I just didn't do it in at the same commit as removal of those non-real activities.
As for the reported bug, is it present in older branches too? (Likely so, don't think the code has changed)
Reply To cazfi
As for the reported bug, is it present in older branches too? (Likely so, don't think the code has changed)
No that I looked at it; yes and no. Older branches avoid actual over-boundaries write by luck. As they have also dummy activities included in the ACTIVITY_LAST count used in determining the size of the target array.
here is an off by one overflow:
https://github.com/freeciv/freeciv/blob/afd94458c31a33f9d72d90c05c253a62f81cc4e0/common/unit.c#L585
see also:
https://github.com/freeciv/freeciv/blob/afd94458c31a33f9d72d90c05c253a62f81cc4e0/common/unit.c#L44
and the following statement is always TRUE and can therefore be removed:
https://github.com/freeciv/freeciv/blob/afd94458c31a33f9d72d90c05c253a62f81cc4e0/common/unit.c#L580