Called C++ object pointer is null in wui /actionconfirm.cc

Bug #1213329 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned

Bug Description

Found by scan-build in r6725.

(last spotted in r6874)

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :
description: updated
description: updated
description: updated
Changed in widelands:
status: New → Triaged
Revision history for this message
SirVer (sirver) wrote :

Ouch. The code used && instead of || which would have let to a nullptr access. Useful tool saved us debugging here!

I am not confident that I changed the code correctly.

Peter, could you check if I did everything correctly in r6925 ? The seafaring code uses an Enum as a state machine, but the same enum also tracks substate which is fragile - It is betting that the enum never changes. In this instance, I am not sure if the two broken explicit checks for Widelands::Ship::TRANSPORT and Widelands::Ship::EXP_COLONIZING where indeed outdated and checking for state_is_expedition() is correct of if some substate must be checked (as it done in the ::ok() method).

Changed in widelands:
status: Triaged → In Progress
assignee: nobody → Nasenbaer (nasenbaer)
milestone: none → build19-rc1
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

This issue is no longer flagged by scan-build, though that is of course no guarantee the fix is 100% correct.

Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Changed in widelands:
status: In Progress → Incomplete
Revision history for this message
Nasenbaer (nasenbaer) wrote :

Wow, took me 1,5 year to do a simple read check - sorry for the delay.

However that was indeed a bug from my side. The way it is since rev. 6925 is correct.
Thanks for fixing this!

Changed in widelands:
status: Incomplete → Fix Committed
assignee: Nasenbaer (nasenbaer) → nobody
importance: Undecided → Medium
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.