]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_session.c: Check for port of zero on incoming SDP.
authorBen Ford <bford@digium.com>
Fri, 8 Nov 2019 19:21:15 +0000 (13:21 -0600)
committerGerrit <noreply@gerrit.asterisk.org>
Thu, 21 Nov 2019 15:35:00 +0000 (09:35 -0600)
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

res/res_pjsip_session.c

index 81f36a7201d07e3a1a88dfdb1d9f633f3c875d08..12cf41deb336ff06782bff8ad437f90da7a2f140 100644 (file)
@@ -235,6 +235,13 @@ static int handle_incoming_sdp(struct ast_sip_session *session, const pjmedia_sd
                        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",