[Freeciv-tickets] [freeciv] #47994: transfer_city(): NULL could_see_uniti for BV_CLR_ALL(could_see_uniti)

Back to archive index
OSDN Ticket System norep****@osdn*****
Mon May 8 14:39:09 JST 2023


#47994: transfer_city(): NULL could_see_uniti for BV_CLR_ALL(could_see_uniti)

  Open Date: 2023-05-08 08:39
Last Update: 2023-05-08 08:39

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

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

Last Changes/Comment on this Ticket:
2023-05-08 08:39 Updated by: cazfi
 * New Ticket "transfer_city(): NULL could_see_uniti for BV_CLR_ALL(could_see_uniti)" created


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

      Reporter: cazfi
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: 3.0.8
     Component: Server
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Clang analyzer (this particular run on S3_1, but I assume all branches affected):
../../../src/server/citytools.c:1099:5: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]
    BV_CLR_ALL(could_see_unit[i]);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/utility/bitvector.h:92:6: note: expanded from macro 'BV_CLR_ALL'
     memset((bv).vec, 0, sizeof((bv).vec));                                 \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/server/citytools.c:1193:14: warning: Array access (via field 'vec') results in a null pointer dereference [core.NullDereference]
        if (!BV_ISSET(could_see_unit[i], player_index(aplayer))
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/utility/bitvector.h:75:5: note: expanded from macro 'BV_ISSET'
   ((bv).vec[_BV_BYTE_INDEX(bit)] & _BV_BITMASK(bit)) != 0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/server/citytools.c:1199:13: warning: Array access (via field 'vec') results in a null pointer dereference [core.NullDereference]
        if (BV_ISSET(could_see_unit[i], player_index(aplayer))) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/utility/bitvector.h:75:5: note: expanded from macro 'BV_ISSET'
   ((bv).vec[_BV_BYTE_INDEX(bit)] & _BV_BITMASK(bit)) != 0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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



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