[Asterisk-code-review] res pjsip mwi.c: Fix null pointer crash (asterisk[15])

Jenkins2 asteriskteam at digium.com
Sat Feb 3 09:54:15 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8134 )

Change subject: res_pjsip_mwi.c: Fix null pointer crash
......................................................................

res_pjsip_mwi.c: Fix null pointer crash

ASTERISK-27652 #close

Change-Id: I78a0d38bfd8d0d82830f3d53da04872d6b67284d
---
M res/res_pjsip_mwi.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 5423038..68d7e8d 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -650,11 +650,11 @@
 		.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);

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I78a0d38bfd8d0d82830f3d53da04872d6b67284d
Gerrit-Change-Number: 8134
Gerrit-PatchSet: 3
Gerrit-Owner: Joshua Elson <joshelson at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180203/dd3ad999/attachment.html>


More information about the asterisk-code-review mailing list