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

fix array overflow with 11S-14S battery in Mavlink #7478

Merged
merged 1 commit into from
Sep 26, 2021

Conversation

stronnag
Copy link
Collaborator

Smashing the stack considered harmful, so let's avoid it.

/home/jrh/Projects/fc/inav/src/main/telemetry/mavlink.c:780:39: error: array subscript 10 is above array bounds of 'uint16_t[4]' {aka 'short unsigned int[4]'} [-Werror=array-bounds]
  780 |                     batteryVoltagesExt[cell] = getBatteryAverageCellVoltage() * 10;
      |                     ~~~~~~~~~~~~~~~~~~^~~~~~

For all those power fiends on 11S - 14S batteries.

@stronnag stronnag added this to the 4.0 milestone Sep 26, 2021
@stronnag stronnag merged commit df1e013 into master Sep 26, 2021
@stronnag stronnag deleted the prevent_11S-14S_overflow_mavlink branch September 26, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant