OSS-Fuzz: Fix fuzz-sip for endpoint fuzzing#4976
Open
arthurscchan wants to merge 2 commits into
Open
Conversation
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SIP fuzzer harness (tests/fuzz/fuzz-sip.c) to better support “endpoint fuzzing” by constructing more realistic pjsip_rx_data packet metadata, acquiring a loop-dgram transport, and routing parsed messages through the endpoint’s module pipeline.
Changes:
- Tighten transaction-layer/UAC transaction preconditions to use
rdata->msg_info.*header shortcuts. - Populate
rdata.pkt_info.src_name/src_portand setVia: received=(recvd_param) for request messages. - Acquire
PJSIP_TRANSPORT_LOOP_DGRAMtransport and runpjsip_endpt_process_rx_data()+pjsip_endpt_handle_events()to exercise the full endpoint pipeline.
| /* Route through the full endpoint module pipeline */ | ||
| if (rdata.tp_info.transport && | ||
| rdata.msg_info.from && rdata.msg_info.to && | ||
| rdata.msg_info.via && rdata.msg_info.cseq && rdata.msg_info.cid) { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+461
to
465
| /* Acquire loop datagram transport */ | ||
| if (pjsip_endpt_acquire_transport(endpt, PJSIP_TRANSPORT_LOOP_DGRAM, | ||
| (pj_sockaddr_t *)&remote_addr, | ||
| sizeof(remote_addr), | ||
| NULL, &fake_transport) == PJ_SUCCESS) { |
|
|
||
| if (msg->type == PJSIP_REQUEST_MSG && rdata.msg_info.via) { | ||
| pj_strdup2(pool, &rdata.msg_info.via->recvd_param, | ||
| rdata.pkt_info.src_name); |
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 fixes the fuzz-sip for endpoint fuzzing.