-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
various getopt & argc index check fixes #9589
Merged
Merged
Conversation
This file contains 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
Fixes the following corner case: mpu9250 start -R This would return a valid result (myoptind < argc), but myoptind pointed to a NULL argument (and thus mpu9250 would crash). With this patch, px4_getopt will return '?', indicating a parser error.
Awesome! |
LorenzMeier
approved these changes
Jun 4, 2018
@bkueng What is the testing level on these? Could you please boot a couple of boards and check the boot log for any abnormalities? |
I compared the boot output against master on Pixracer, Pixhawk v2 and v5. It's exactly the same. |
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.
The following commands would all lead to a crash when called w/o argument:
bma180
bmi160
bmm150
bmp280
ets_airspeed
iridiumsbd
lis3mdl
lps22hb
mb12xx
mpu6000
mpu9250
ms4525_airspeed
ms5525_airspeed
ms5611
position_estimator_inav
pwm_input
sdp3x_airspeed
sf0x
teraranger
tfmini
sf1xx
srf02
test_ppm
This PR fixes all of these and switches from
getopt
topx4_getopt
. In addition, there's a fix for a corner case inpx4_getopt
.Fixes: #9532