Update fuzz.js Improve Fuzzing Coverage and Robustness in fuzz.js for OSS-Fuzz Integration
PR Description: Enhanced the file to improve input variation, validate decompressed outputs, and handle edge cases for compression and decompression. Added parameter range checks, gzip header testing, and improved error logging for better OSS-Fuzz integration and increased line coverage.
Changes Done in Code:
-
Enhanced Input Variation:
- Added valid ranges for parameters (
level,windowBits,memLevel,strategy) usingconsumeIntegralInRange. - Tested edge cases like empty inputs and large inputs (up to 10 MB).
- Added valid ranges for parameters (
-
Output Validation:
- Implemented checks to ensure decompressed data matches the original input for
inflate,inflateRaw, andungzip.
- Implemented checks to ensure decompressed data matches the original input for
-
Extended Gzip Testing:
- Added gzip options with
headerparameter (including metadata liketext,time,os, andextra).
- Added gzip options with
-
Improved Error Handling:
- Logged unhandled errors for debugging.
- Enhanced
ignoredErrorto capture additional error contexts.
-
Code Modularity:
- Modularized repeated logic (e.g., byte array comparison with
arraysEqualfunction).
- Modularized repeated logic (e.g., byte array comparison with
Shivam7-1 is a new contributor to projects/pako. The PR must be approved by known contributors before it can be merged. The past contributors are: 0xricksanchez
Hii @0xricksanchez Could you please Review this PR Is above changes is ok to move forward? Thanks
Hii @DavidKorczynski Could you please Merge this PR as it was Approved @DavidKorczynski Just a Reminder for merging PR Thanks
Hii @DavidKorczynski is there Anything else is Required From My side to get this PR merge Thanks
@Shivam7-1 Stop creating, deleting and creating new comments that beg for the PR to be merged. These folks are busy. Give it at least a week for pinging anyone..
Hii @DavidKorczynski Just a Reminder for merging PR CC @DonggeLiu Thanks