forked from the-tcpdump-group/libpcap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux USB: avoid 32-bit unsigned integer wraparound.
When adding values whose sum might overflow an unsigned integer, first check whether the sum *would* overflow an unsigned integer and, if so, clamp the sum at UINT_MAX. Do the same for a multiplication. This should fix the-tcpdump-group#1134, as well as the issue in the-tcpdump-group#1205.
- Loading branch information
1 parent
1f991a5
commit fe86a19
Showing
1 changed file
with
66 additions
and
7 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