-
-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libusb0/1: Simplify range checks in nut API nut_libusb_get_string()
The string index is a number between 1 and 255, simply because it is the lower byte of wValue in the GET_DESCRIPTOR request. String index 0 is used for retrieving the langid array, so it is not valid for this function. There is no reason to impose a limit to the length of the buffer that the user is lending us, certainly not above the range of the involved types, so just a minimal sanity check is enough. Since in the minimal case we would return an empty zero-terminated string, it must at least have room for this. Signed-off-by: Tormod Volden <[email protected]>
- Loading branch information
1 parent
f3ebe44
commit 03c1ea7
Showing
2 changed files
with
3 additions
and
36 deletions.
There are no files selected for viewing
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
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