summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Griepentrog <scott@griepentrog.com>2015-08-26 15:26:00 -0500
committerScott Griepentrog <scott@griepentrog.com>2015-08-26 15:26:00 -0500
commit6bfa14bdad3f0f00923c386a5e7db9621a9719ff (patch)
tree03cafb985d1e6c30aa851afcec5cb5c4b781d6d4
parentd03d09aad30320b2e80c6473021116982c91cee2 (diff)
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
-rw-r--r--res/res_pjsip_sdp_rtp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index f1314f528..96ef91f84 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -611,6 +611,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")) {