From 077573813749ed192d9fb4796887a71050b5a6c5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 19 Dec 2019 17:37:07 +1100 Subject: [PATCH] Copter: fixed range check for RC channel --- ArduCopter/RC_Channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArduCopter/RC_Channel.h b/ArduCopter/RC_Channel.h index 45146bc82d..16b7392485 100644 --- a/ArduCopter/RC_Channel.h +++ b/ArduCopter/RC_Channel.h @@ -31,7 +31,7 @@ public: RC_Channel_Copter obj_channels[NUM_RC_CHANNELS]; RC_Channel_Copter *channel(const uint8_t chan) override { - if (chan > NUM_RC_CHANNELS) { + if (chan >= NUM_RC_CHANNELS) { return nullptr; } return &obj_channels[chan];