待辦事項 #48563

sg_load_player_main() stringop-overflow

啟用日期: 2023-09-02 17:43 最後更新: 2023-09-04 09:43

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
1

細節

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 History (3/4 Histories)

2023-09-02 17:43 Updated by: cazfi
  • New Ticket "sg_load_player_main() stringop-overflow" created
2023-09-02 18:30 Updated by: cazfi
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from to Accepted
  • 里程碑 Update from (無) to 3.0.9 (closed)
2023-09-04 09:43 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入