Skip to content

Commit

Permalink
Copter: avoid nullptr deref in config_error_loop
Browse files Browse the repository at this point in the history
we may enter the config_error_loop before we call Copter's methods which allocate the wpnav object.

We send mavlink messages in the config error loop, one of which calls this method - so we end up with a nullptr dereference.

We might be able to find a way to stop sending this message in the config error loop, but that's likely to take some time to do....
  • Loading branch information
peterbarker authored and tridge committed Aug 27, 2024
1 parent a33a0d1 commit 46d37ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ArduCopter/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,7 @@ bool ModeAuto::resume()

bool ModeAuto::paused() const
{
return wp_nav->paused();
return (wp_nav != nullptr) && wp_nav->paused();
}

#endif

0 comments on commit 46d37ab

Please sign in to comment.