Tíquete #45275

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

: 2022-07-30 12:12 Última Atualização: 2022-08-09 15:30

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
1

Details

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
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Nenhum to Accepted
2022-08-09 15:30 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login