mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 16:50:14 +00:00
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
This commit is contained in:
@@ -611,6 +611,9 @@ static enum ast_sip_session_media_encryption get_media_encryption_type(pj_str_t
|
|||||||
|
|
||||||
*optimistic = 0;
|
*optimistic = 0;
|
||||||
|
|
||||||
|
if (!transport_str) {
|
||||||
|
return AST_SIP_MEDIA_TRANSPORT_INVALID;
|
||||||
|
}
|
||||||
if (strstr(transport_str, "UDP/TLS")) {
|
if (strstr(transport_str, "UDP/TLS")) {
|
||||||
return AST_SIP_MEDIA_ENCRYPT_DTLS;
|
return AST_SIP_MEDIA_ENCRYPT_DTLS;
|
||||||
} else if (strstr(transport_str, "SAVP")) {
|
} else if (strstr(transport_str, "SAVP")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user