[Asterisk-code-review] Chaos: handle failed allocation in get media encryption type (asterisk[master])

Scott Griepentrog asteriskteam at digium.com
Wed Aug 26 15:30:25 CDT 2015


Scott Griepentrog has uploaded a new change for review.

  https://gerrit.asterisk.org/1147

Change subject: Chaos: handle failed allocation in get_media_encryption_type
......................................................................

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
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/47/1147/1

diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index f1314f5..96ef91f 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -611,6 +611,9 @@
 
 	*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")) {

-- 
To view, visit https://gerrit.asterisk.org/1147
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4b905ce6d03da53fea526224455c1044b1a5a28
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-code-review mailing list