OSS-Fuzz: Add fuzzer for dns records parsing#4857
Open
arthurscchan wants to merge 1 commit intopjsip:masterfrom
Open
OSS-Fuzz: Add fuzzer for dns records parsing#4857arthurscchan wants to merge 1 commit intopjsip:masterfrom
arthurscchan wants to merge 1 commit intopjsip:masterfrom
Conversation
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new OSS-Fuzz/libFuzzer target to exercise DNS record parsing APIs in pjlib-util, and wires it into the tests/fuzz build.
Changes:
- Added
fuzz-dns-recordstarget to parse DNS packets and attempt A/AAAA record extraction. - Updated
tests/fuzz/Makefileto compile/link/clean the new fuzzer binary.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/fuzz/fuzz-dns-records.c |
New fuzzer entry point for DNS packet + A/AAAA record parsing. |
tests/fuzz/Makefile |
Builds and cleans the new fuzz-dns-records binary. |
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+48
to
+55
| /* Skip tiny inputs */ | ||
| if (Size < 12) | ||
| return 0; | ||
|
|
||
| /* Create pool for this iteration */ | ||
| pool = pj_pool_create(mem, "dns", POOL_SIZE, POOL_SIZE, NULL); | ||
| if (!pool) | ||
| return 0; |
| return 0; | ||
|
|
||
| /* Test DNS packet parsing */ | ||
| status = pj_dns_parse_packet(pool, (void*)Data, Size, &dns); |
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 fuzzer targetting dns-records parsing.