From c9c72eb9ca86ab3be91ec1e24877a020cea0e825 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 19 Dec 2019 17:37:07 +1100 Subject: [PATCH] Tracker: fixed range check for RC channel --- AntennaTracker/RC_Channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AntennaTracker/RC_Channel.h b/AntennaTracker/RC_Channel.h index 5e10baad17..0b4a20a4a4 100644 --- a/AntennaTracker/RC_Channel.h +++ b/AntennaTracker/RC_Channel.h @@ -19,7 +19,7 @@ public: RC_Channel_Tracker obj_channels[NUM_RC_CHANNELS]; RC_Channel_Tracker *channel(const uint8_t chan) override { - if (chan > NUM_RC_CHANNELS) { + if (chan >= NUM_RC_CHANNELS) { return nullptr; } return &obj_channels[chan];