Repository navigation
Conversation
The geozone command accepted index 63 although the last zone is 62, so the following assignments wrote one element past the geoZonesConfig array.
Contributor
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn these tips off under Display > Comment parts |
PR Summary by QodoReject out-of-range geozone indices in the CLI
AI Description
Merge Risk
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12225
geozone <idx> ...checkedidx > MAX_GEOZONES_IN_CONFIG, so index 63 got through even though the array has 63 zones (0-62). The command then wrote shape, type, altitudes and the rest one element pastgeoZonesConfig. The check is now>=, which matches the range the error message already prints and the check ingeozone vertex.Testing: I ran the SITL build and sent
geozone 62 1 1 -100000 100000 0 2 4andgeozone 63 1 1 -100000 100000 0 2 4over the CLI. Before the change both were accepted with no output. With it, 62 is still accepted and 63 printsgeozone index must be between 0 and 62. The unit tests (make check, 635 tests) pass, though none of them cover cli.c.