Repository navigation
OSS-Fuzz: Add new fuzzer targets compression - #3678
Open
arthurscchan wants to merge 2 commits into
Open
arthurscchan wants to merge 2 commits into
arthurscchan wants to merge 2 commits into
Conversation
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
5 open issues
The comment and stated goal mention fuzzing gzip/zlib “both window styles” and feeding raw bytes to… · New This file directly referencesgoogle::protobuf::io::GzipOutputStream::ZLIBbut does not include… · New This file directly referencesgoogle::protobuf::io::GzipOutputStream::ZLIBbut does not include… · New The comment and stated goal mention fuzzing gzip/zlib “both window styles” and feeding raw bytes to… · New The only hard requirement before readingdata[0]issize >= 1, but the fuzzer currently… · New
What changed in this PR
Adds a new OSS-Fuzz target to exercise brpc compression/decompression code paths and integrates it into the fuzz build lists.
Changes:
- Add
fuzz_compresslibFuzzer target focusing on gzip/zlib/snappy compression policies. - Include
fuzz_compressin the local fuzz CMake target list. - Include
fuzz_compressin the OSS-Fuzz build script target list.
| File | Description |
|---|---|
| test/fuzzing/oss-fuzz.sh | Builds the new fuzz_compress target for OSS-Fuzz. |
| test/fuzzing/fuzz_compress.cpp | New fuzzer that exercises gzip/zlib/snappy compress/decompress paths. |
| test/CMakeLists.txt | Registers fuzz_compress in FUZZ_TARGETS so it’s built with other fuzzers. |
Review effort: Lite
Comment on lines
+18
to
+21
| // Fuzz brpc's compression policies on the wire direction that servers are | ||
| // attacked through: fuzz bytes are compressed with gzip/zlib (both window | ||
| // styles) or snappy, and arbitrary fuzz bytes are also fed straight into the | ||
| // decompressors (the hostile-compressed-payload model). |
| #include "butil/iobuf.h" | ||
| #include "brpc/policy/gzip_compress.h" | ||
| #include "brpc/policy/snappy_compress.h" | ||
|
|
Comment on lines
+39
to
+41
| brpc::policy::GzipCompressOptions opts; | ||
| brpc::policy::GzipCompressOptions zlib_opts; | ||
| zlib_opts.format = google::protobuf::io::GzipOutputStream::ZLIB; |
| // hostile compressed payload: feed the raw fuzz bytes to every | ||
| // decompressor | ||
| brpc::policy::GzipDecompress(in, &out); | ||
| out.clear(); |
Comment on lines
+29
to
+33
| if (size < 5) { | ||
| return 0; | ||
| } | ||
|
|
||
| const uint8_t mode = data[0] % 5; |
Copilot stopped reviewing on behalf of
wwbmmm due to an error
November 12, 2026 11:03
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.


This PR creates a new OSS-Fuzz fuzzer targets compression for improving the overall fuzzing coverage and effectiveness of project brpc.