Ticket #45275

dai_spend_gold(): clang analyzer warning about NULL derefence from pcity

Date d'ouverture: 2022-07-30 12:12 Dernière mise à jour: 2022-08-09 15:30

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

Détails

Seen on S3_0: clang analyzer warns about pcity->anarchy in dai_spend_gold() to potentially be a NULL dereference.

I don't think it can ever be, as then also the bestchoice.value would be left to value 0, which causes loop to break before reaching that pcity->anarchy.

However, the coding style around there isn't really good considering that choice.want is a floating point number. It makes sense to refactor the code a bit, and presumably to get rid of the clang analyzer warning in the process.

Ticket History (3/4 Histories)

2022-07-30 12:12 Updated by: cazfi
  • New Ticket "dai_spend_gold(): clang analyzer warning about NULL derefence from pcity" created
2022-07-31 21:07 Updated by: cazfi
  • Propriétaire Update from (Aucun) to cazfi
  • Résolution Update from Aucun to Accepted
2022-08-09 15:30 Updated by: cazfi
  • État Update from Ouvert to Atteints
  • Résolution Update from Accepted to Fixed

Modifier

Please login to add comment to this ticket » Connexion