Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_RC_Protocol: protect SBUS against bad values #25169

Merged
merged 7 commits into from
Oct 12, 2023
Prev Previous commit
AP_RCProtocol: prevent decoding past end of output array
this fixes test_sbus on clang
  • Loading branch information
tridge committed Oct 4, 2023
commit 3037d5b50a225fead830b41a98cb306f84abfd3c
2 changes: 1 addition & 1 deletion libraries/AP_RCProtocol/AP_RCProtocol_SBUS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down