#46527: off by one buffer overflow Open Date: 2023-01-16 23:09 Last Update: 2023-01-16 23:21 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/46527 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46527 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-01-16 23:21 Updated by: cazfi Comment: 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) --------------------------------------------------------------------- Ticket Status: Reporter: mortmann Owner: (None) Type: Bugs Status: Open Priority: 5 - Medium MileStone: (None) Component: (None) Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: 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 -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/46527 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46527