Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed SDP media transport protocol info parsing #3802

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Fixed SDP media transport protocol info parsing #3802

merged 1 commit into from
Dec 14, 2023

Conversation

sauwming
Copy link
Member

To fix #3800.

Summary of the report:
In pjmedia_sdp_transport_get_proto():

idx = pj_strtok2(tp, "/", &token, 0);
if (idx != tp->slen)
        pj_strset(&rest, tp->ptr + token.slen + 1, tp->slen - token.slen - 1);

rest.slen will be set to -1 if delimiter / is not found within the string, such as if the transport is plain udp.

This causes the subsequent check within the function to not work properly:

    } else if (pj_stricmp2(&token, "UDP") == 0) {
        /* Starts with "UDP" */

        /* Plain UDP */
        if (rest.slen == 0)
            return PJMEDIA_TP_PROTO_UDP;

Thank you to @miguelpenades for the report and the patch.

@sauwming sauwming merged commit 043926a into master Dec 14, 2023
30 of 35 checks passed
@sauwming sauwming deleted the sdp-proto branch December 14, 2023 04:22
xhit pushed a commit to xhit/pjproject that referenced this pull request Dec 18, 2023
dshamaev-intermedia pushed a commit to intermedia-net/pjproject that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assertion when receiving INVITE with sdp media "m=application 48180 udp"
3 participants