Incidencia #45275

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

Abrir Fecha: 2022-07-30 12:12 Última actualización: 2022-08-09 15:30

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
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
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Ninguno to Accepted
2022-08-09 15:30 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed

Editar

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