[Asterisk-code-review] res_pjsip_session.c: Check for port of zero on incoming SDP. (asterisk[13.29])

Benjamin Keith Ford asteriskteam at digium.com
Thu Nov 21 14:41:34 CST 2019


Benjamin Keith Ford has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13282 )

Change subject: res_pjsip_session.c: Check for port of zero on incoming SDP.
......................................................................

res_pjsip_session.c: Check for port of zero on incoming SDP.

If a re-invite comes in initiating T.38, but there is no c line in the
SDP and the port is also 0, a crash can occur. A check is now done on
the port to see if the steam is already declined, preventing the crash.
The logic was moved to res_pjsip_session.c because it is handled in a
similar manner in later versions of Asterisk.

ASTERISK-28612
Reported by: Salah Ahmed

Change-Id: Ifc4a0d05b32c7f2156e77fc8435a6ecaa6abada0
(cherry picked from commit c257794330db49f4079a7108d51da60696269b36)
---
M res/res_pjsip_session.c
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 0cc514a..88e2121 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -235,6 +235,13 @@
 			continue;
 		}
 
+		/* If we have a port of 0, ignore this stream */
+		if (!sdp->media[i]->desc.port) {
+			ast_debug(1, "Declining incoming SDP media stream '%s' at position '%d'\n",
+				session_media->stream_type, i);
+			continue;
+		}
+
 		if (session_media->handler) {
 			handler = session_media->handler;
 			ast_debug(1, "Negotiating incoming SDP media stream '%s' using %s SDP handler\n",

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13282
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13.29
Gerrit-Change-Id: Ifc4a0d05b32c7f2156e77fc8435a6ecaa6abada0
Gerrit-Change-Number: 13282
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-CC: Friendly Automation
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191121/cc439c1a/attachment.html>


More information about the asterisk-code-review mailing list