From: Scott Griepentrog Date: Wed, 26 Aug 2015 20:26:00 +0000 (-0500) Subject: Chaos: handle failed allocation in get_media_encryption_type X-Git-Tag: 13.6.0-rc1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6862c2a167f4ed2cb8511bb1ae94a13582afa25b;p=thirdparty%2Fasterisk.git Chaos: handle failed allocation in get_media_encryption_type If the ast_strndup() call fails to allocate a copy of the transport string for parsing, fail gracefully. ASTERISK-25323 Reported by: Scott Griepentrog Change-Id: Ia4b905ce6d03da53fea526224455c1044b1a5a28 --- diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 0a5cbcbf9b..208d348334 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -602,6 +602,9 @@ static enum ast_sip_session_media_encryption get_media_encryption_type(pj_str_t *optimistic = 0; + if (!transport_str) { + return AST_SIP_MEDIA_TRANSPORT_INVALID; + } if (strstr(transport_str, "UDP/TLS")) { return AST_SIP_MEDIA_ENCRYPT_DTLS; } else if (strstr(transport_str, "SAVP")) {