[Core] Fix switch_core_media_patch_sdp parsing m=text wrongly

This commit is contained in:
prabhugithubme 2022-04-07 17:52:25 +05:30 committed by GitHub
parent 70a1761ab5
commit 4886383e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 21 deletions

View File

@ -12207,7 +12207,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
char o_line[1024] = "";
if (oe >= pe) {
bad = 5;
bad = 4;
goto end;
}
@ -12263,7 +12263,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
p += 8;
if (p >= pe) {
bad = 4;
bad = 6;
goto end;
}
@ -12271,7 +12271,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
q += 8;
if (q >= qe) {
bad = 5;
bad = 7;
goto end;
}
@ -12280,13 +12280,13 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
q += strlen(port_buf);
if (q >= qe) {
bad = 6;
bad = 8;
goto end;
}
while (p && *p && (*p >= '0' && *p <= '9')) {
if (p >= pe) {
bad = 7;
bad = 9;
goto end;
}
p++;
@ -12327,14 +12327,14 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
p += 8;
if (p >= pe) {
bad = 8;
bad = 10;
goto end;
}
q += 8;
if (q >= qe) {
bad = 9;
bad = 11;
goto end;
}
@ -12342,14 +12342,14 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
q += strlen(vport_buf);
if (q >= qe) {
bad = 10;
bad = 12;
goto end;
}
while (p && *p && (*p >= '0' && *p <= '9')) {
if (p >= pe) {
bad = 11;
bad = 13;
goto end;
}
@ -12357,7 +12357,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
}
has_video++;
} else if (!strncmp("m=text ", p, 8) && *(p + 8) != '0') {
} else if (!strncmp("m=text ", p, 7) && *(p + 7) != '0') {
if (!has_text) {
switch_core_media_choose_port(session, SWITCH_MEDIA_TYPE_TEXT, 1);
clear_pmaps(t_engine);
@ -12386,18 +12386,18 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
//TEXT switch_core_media_set_text_codec(session, SWITCH_FALSE);
}
strncpy(q, p, 8);
p += 8;
strncpy(q, p, 7);
p += 7;
if (p >= pe) {
bad = 8;
bad = 14;
goto end;
}
q += 8;
q += 7;
if (q >= qe) {
bad = 9;
bad = 15;
goto end;
}
@ -12405,14 +12405,14 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
q += strlen(tport_buf);
if (q >= qe) {
bad = 10;
bad = 16;
goto end;
}
while (p && *p && (*p >= '0' && *p <= '9')) {
if (p >= pe) {
bad = 11;
bad = 17;
goto end;
}
@ -12426,12 +12426,12 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
while (p && *p && *p != '\n') {
if (p >= pe) {
bad = 12;
bad = 18;
goto end;
}
if (q >= qe) {
bad = 13;
bad = 19;
goto end;
}
@ -12439,12 +12439,12 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
}
if (p >= pe) {
bad = 14;
bad = 20;
goto end;
}
if (q >= qe) {
bad = 15;
bad = 21;
goto end;
}