チケット #48290

team_new() NULL tslot reference

登録: 2023-06-25 22:46 最終更新: 2023-07-16 11:19

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
6

詳細

Clang analyzer S3_1:

../../../src/common/team.c:340:15: warning: Access to field 'team' results in a dereference of a null pointer (loaded from variable 'tslot') [core.NullDereference]
  tslot->team = pteam;

I think there's an actual bug that tslot IS left as NULL after the earlier iteration to find a free slot. When called from team_add_player() there might be max number of both players and teams already (both MAX_NUM_PLAYER_SLOTS), *and* the attempt to create a new team is before freeing the old one.

チケットの履歴 (14 件中 3 件表示)

2023-06-25 22:46 更新者: cazfi
  • 新しいチケット "team_new() NULL tslot reference" が作成されました
2023-06-25 22:46 更新者: cazfi
  • 詳細が更新されました
2023-07-09 10:08 更新者: cazfi
2023-07-10 07:44 更新者: cazfi
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法なし から 受領 に更新されました
コメント

Reply To cazfi

I think there's an actual bug

No upper level code is currently affected. S3_2 & main branch patches address the issue, but as the fix causes savegame format and network protocol breakage, that part is not backported to frozen branches. Also assert to player creation is added only in S3_2 & main.

2023-07-10 22:23 更新者: cazfi
  • 添付ファイル 0019-Check-that-team_new-has-found-a-free-team-slot.patch (File ID: 12859) が付加されました
2023-07-10 22:25 更新者: cazfi
  • 添付ファイル 0019-Check-that-team_new-has-found-a-free-team-slot.patch (File ID: 12859) が削除されました
2023-07-10 23:01 更新者: cazfi
コメント

New versions of main & S3_2 patches, making researches_array big enough.

2023-07-16 11:19 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする