Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
The insertAlwaysEncodeChars() method takes in a random byte array (through the constructor of PercentCodec class) and processes it byte by byte. Each byte is passed to insertAlwaysEncodeChar() to set the corresponding bit in the BitSet object alwaysEncodeChars to true by calling the set() method of the BitSet object. As BitSet only accept positive index, if any byte is negative, it will cause IndexOutOfBoundsException when calling the set() method.
Possible fix could add a conditional check to ensure only valid bytes (positive or zero) are processed.
We found this bug using fuzzing by way of OSS-Fuzz. It is reported at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64362.
Attachments
Issue Links
- links to