[Freeciv-tickets] [freeciv] #48563: sg_load_player_main() stringop-overflow

アーカイブの一覧に戻る
OSDN Ticket System norep****@osdn*****
Sat Sep 2 17:43:31 JST 2023


#48563: sg_load_player_main() stringop-overflow

  Open Date: 2023-09-02 11:43
Last Update: 2023-09-02 11:43

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

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

Last Changes/Comment on this Ticket:
2023-09-02 11:43 Updated by: cazfi
 * New Ticket "sg_load_player_main() stringop-overflow" created


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

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

Ticket details:

Main branch, meson based build with O3 optimization:
In file included from ../../src/server/savegame/savegame3.c:75:
../../src/server/savegame/savegame3.c: In function ‘sg_load_player_main’:
../../src/utility/bitvector.h:79:35: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
   79 |     (bv).vec[_BV_BYTE_INDEX(bit)] |= _BV_BITMASK(bit);                      \
      |                                   ^
../../src/server/savegame/savegame3.c:4104:5: note: in expansion of macro ‘BV_SET’
 4104 |     BV_SET(plr->flags, fid);
      |     ^~~~~~
../../src/utility/bitvector.h:128:34: note: at offset 536870911 into destination object ‘vec’ of size 1
  128 |   typedef struct { unsigned char vec[_BV_BYTES(bits)]; } name
      |                                  ^~~
./specenum_gen.h:9049:1: note: in expansion of macro ‘BV_DEFINE’
 9049 | BV_DEFINE(SPECENUM_BITVECTOR, (SPECENUM_MAX_VALUE + 1));
      | ^~~~~~~~~
There's identical error from savegame2.c compile.

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



More information about the Freeciv-tickets mailing list
アーカイブの一覧に戻る