[Freeciv-tickets] [freeciv] #44449: count_ *_near_tile() theoretical division by zero

Back to archive index
OSDN Ticket System norep****@osdn*****
Wed May 4 23:01:18 JST 2022


#44449: count_ *_near_tile() theoretical division by zero

  Open Date: 2022-04-24 01:52
Last Update: 2022-05-04 17:01

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/44449
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44449

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-05-04 17:01 Updated by: cazfi
 * Status Update from Open to Closed
 * Resolution Update from Accepted to Fixed


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: cazfi
          Type: Bugs
        Status: Closed
      Priority: 5 - Medium
     MileStone: 3.0.2
     Component: General
      Severity: 5 - Medium
    Resolution: Fixed
---------------------------------------------------------------------

Ticket details:

Clang static analyzer complains about a number of count_*_near_tile() functions that first iterate adjacent tiles, and count them in the process, and then use that total as a divider. While the iteration can go over less-than-number-of-directions tiles when on the edge of the world, it would result in zero only for a single tile world. So this is more about silencing the report than fixing an actual bug.

-- 
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/44449
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44449



More information about the Freeciv-tickets mailing list
Back to archive index