From c858b7201d056da5fa7266d8bd0bb9c7e7355ae3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 5 Oct 2023 08:20:23 +1100 Subject: [PATCH] AP_RCProtocol: prevent decoding past end of output array this fixes test_sbus on clang --- libraries/AP_RCProtocol/AP_RCProtocol_SBUS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_RCProtocol/AP_RCProtocol_SBUS.cpp b/libraries/AP_RCProtocol/AP_RCProtocol_SBUS.cpp index 71a7c306c5..b3d30b27bf 100644 --- a/libraries/AP_RCProtocol/AP_RCProtocol_SBUS.cpp +++ b/libraries/AP_RCProtocol/AP_RCProtocol_SBUS.cpp @@ -97,7 +97,7 @@ bool AP_RCProtocol_SBUS::sbus_decode(const uint8_t frame[25], uint16_t *values, uint16_t chancount = SBUS_INPUT_CHANNELS; - decode_11bit_channels((const uint8_t*)(&frame[1]), SBUS_INPUT_CHANNELS, values, + decode_11bit_channels((const uint8_t*)(&frame[1]), max_values, values, SBUS_TARGET_RANGE, SBUS_RANGE_RANGE, SBUS_SCALE_OFFSET); /* decode switch channels if data fields are wide enough */