mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 07:03:34 +08:00
pwm_out_sim PWM_SERVO_SET_MAX_PWM fix index check
- fixes coverity CID 264263
This commit is contained in:
@@ -367,8 +367,7 @@ PWMSim::ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
for (unsigned i = 0; i < pwm->channel_count; i++) {
|
||||
|
||||
if (i <= MAX_ACTUATORS) {
|
||||
if (i < MAX_ACTUATORS) {
|
||||
_pwm_max[i] = pwm->values[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user