From 46d37abcf72d72c394484a282422e0589111f618 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 24 Aug 2024 10:47:40 +1000 Subject: [PATCH] Copter: avoid nullptr deref in config_error_loop 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.... --- ArduCopter/mode_auto.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArduCopter/mode_auto.cpp b/ArduCopter/mode_auto.cpp index 08f41f06c7..8a009901a6 100644 --- a/ArduCopter/mode_auto.cpp +++ b/ArduCopter/mode_auto.cpp @@ -2330,7 +2330,7 @@ bool ModeAuto::resume() bool ModeAuto::paused() const { - return wp_nav->paused(); + return (wp_nav != nullptr) && wp_nav->paused(); } #endif