Ticket #46099

sdl2: clang analyzer NULL dereference warning about unit_select_dialog_popup()

Date d'ouverture: 2022-11-23 05:30 Dernière mise à jour: 2022-11-28 07:17

Rapporteur:
Propriétaire:
Type:
État:
Atteints
Composant:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
2

Détails

S3_0 (but other branches likely affected): unit_select_dialog_popup() does unit_tile(pUnit). Clang analyzer is worried that it causes reference through NULL pUnit. That's not real problem, as if the tile unit list size is zero, we never reach that part, and pUnit is the topmost unit in the stack.

However, the code makes no sense, either. We already know that the unit is in the list of the original ptile, so certainly its tile is ptile. No need to seek for that. If that was not the case, we would be looking value from effectively random unit from the stack like representing all of them.

Ticket History (3/5 Histories)

2022-11-23 05:30 Updated by: cazfi
  • New Ticket "sdl2: clang analyzer NULL dereference warning about unit_select_dialog_popup()" created
2022-11-23 05:52 Updated by: cazfi
  • Propriétaire Update from (Aucun) to cazfi
  • Résolution Update from Aucun to Accepted
2022-11-28 07:17 Updated by: cazfi
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion