Skip to content
Snippets Groups Projects
Commit a7aea71e authored by Torrey Searle's avatar Torrey Searle Committed by George Joseph
Browse files

res/res_pjsip_diversion: prevent crash on tel: uri in History-Info

Add a check to see if the URI is a Tel URI and prevent crashing on
trying to retrieve the reason parameter.

ASTERISK-29191
ASTERISK-29219

Change-Id: I0320aa205f22cda511d60a2edf2b037e8fd6cc37
parent 13682210
No related branches found
No related tags found
No related merge requests found
......@@ -314,8 +314,14 @@ static void set_redirecting_reason_by_cause(pjsip_name_addr *name_addr,
{
static const pj_str_t cause_name = { "cause", 5 };
pjsip_sip_uri *uri = pjsip_uri_get_uri(name_addr);
pjsip_param *cause = pjsip_param_find(&uri->other_param, &cause_name);
unsigned long cause_value;
pjsip_param *cause = NULL;
unsigned long cause_value = 0;
if (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri)) {
return;
}
cause = pjsip_param_find(&uri->other_param, &cause_name);
if (!cause) {
return;
......@@ -377,6 +383,7 @@ static void set_redirecting(struct ast_sip_session *session,
ast_party_redirecting_init(&data);
memset(&update, 0, sizeof(update));
data.reason.code = AST_REDIRECTING_REASON_UNKNOWN;
if (from_info) {
set_redirecting_id((pjsip_name_addr*)from_info->uri,
&data.from, &update.from);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment