mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
output_omni() sized a stack buffer by the runtime _motors_num. VLAs are non-standard C++, and clang-scan-build cannot correlate the loop which fills the buffer with the loop which reads it back, so it reports the read as a garbage value. Size the buffer to AP_MOTORS_NUM_MOTORS_MAX and zero-initialise it. setup_omni() only ever sets _motors_num to 3 or 4, and the _throttle_factor / _steering_factor / _lateral_factor arrays it is indexed alongside are already that size, so the buffer is large enough; the initialiser additionally makes the read defined whatever the analyser assumes about _motors_num. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>