From: Joshua Elson Date: Thu, 1 Feb 2018 19:01:25 +0000 (-0500) Subject: res_pjsip_mwi.c: Fix null pointer crash X-Git-Tag: 13.20.0-rc1~45^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8125b825d384bcdd26d16d6f3dbece6461fd89e9;p=thirdparty%2Fasterisk.git res_pjsip_mwi.c: Fix null pointer crash ASTERISK-27652 #close Change-Id: I78a0d38bfd8d0d82830f3d53da04872d6b67284d --- diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c index 05eee782e9..f2ddf576e2 100644 --- a/res/res_pjsip_mwi.c +++ b/res/res_pjsip_mwi.c @@ -650,11 +650,11 @@ static void send_mwi_notify(struct mwi_subscription *sub) .body_type = AST_SIP_MESSAGE_ACCUMULATOR, .body_data = &counter, }; - const char *resource = ast_sip_subscription_get_resource_name(sub->sip_sub); ao2_callback(sub->stasis_subs, OBJ_NODATA, get_message_count, &counter); if (sub->is_solicited) { + const char *resource = ast_sip_subscription_get_resource_name(sub->sip_sub); struct ast_sip_endpoint *endpoint = ast_sip_subscription_get_endpoint(sub->sip_sub); struct ast_sip_aor *aor = find_aor_for_resource(endpoint, resource); pjsip_dialog *dlg = ast_sip_subscription_get_dialog(sub->sip_sub);