[Asterisk-code-review] Chaos: handle failed allocation in get media encryption type (asterisk[13])
Scott Griepentrog
asteriskteam at digium.com
Wed Aug 26 15:32:29 CDT 2015
Scott Griepentrog has uploaded a new change for review.
https://gerrit.asterisk.org/1148
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/48/1148/1
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 0a5cbcb..208d348 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -602,6 +602,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/1148
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4b905ce6d03da53fea526224455c1044b1a5a28
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>
More information about the asterisk-code-review
mailing list