From 2073d65975f1e15081509ea5ee4c6bbbd0f5ebf5 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 20 Sep 2017 09:50:31 +0900 Subject: [PATCH] Plane: command-long DO_SET_HOME check first param is zero --- ArduPlane/GCS_Mavlink.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArduPlane/GCS_Mavlink.cpp b/ArduPlane/GCS_Mavlink.cpp index ad99f84a3b..125c6d7c35 100644 --- a/ArduPlane/GCS_Mavlink.cpp +++ b/ArduPlane/GCS_Mavlink.cpp @@ -1321,6 +1321,10 @@ void GCS_MAVLINK_Plane::handleMessage(mavlink_message_t* msg) if (is_equal(packet.param1,1.0f)) { plane.init_home(); } else { + // ensure param1 is zero + if (!is_zero(packet.param1)) { + break; + } if (is_zero(packet.param5) && is_zero(packet.param6) && is_zero(packet.param7)) { // don't allow the 0,0 position break;