Conversation
The USB device number given as argument to the '-d' option is parsed with a strtol() call with 0 base. This is an issue with USB device numbers that start with a 0 (and they do tend to start with a 0, e.g. from lsusb output: "Bus 001 Device 014"), because strtol() with 0 base interprets them as an octal number. Consequently, the program might not find the device, or, worse, might find and operate on the wrong device. Fix this by explicitly specifying base 10 to the strtol() call converting the device number. All other strtol() calls already explicitly specify a 10 or 16 base.
For the '-d' option the code expects the bus and device numbers in the format "bus.dev", i.e. separated by a dot, but the documentation and help text mention "bus:dev", i.e. separated by a colon. Update all documentation and help text to match the code.
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.
Fix a bug which likely parses the device number in the argument of the
-doption as an octal number, and correct the syntax of the-doption's argument in the help text and the documentation.