[Asterisk-code-review] res pjsip pubsub: Resolve potential crash in allocate subscr... (asterisk[15])

Jenkins2 asteriskteam at digium.com
Mon Oct 30 10:05:19 CDT 2017


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

Change subject: res_pjsip_pubsub: Resolve potential crash in allocate_subscription.
......................................................................

res_pjsip_pubsub: Resolve potential crash in allocate_subscription.

When allocate_subscription fails to initialize fields of the new sub it
calls destroy_subscription.

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

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index a1bfbb7..62b1879 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1089,7 +1089,7 @@
 static void destroy_subscription(struct ast_sip_subscription *sub)
 {
 	ast_debug(3, "Destroying SIP subscription from '%s->%s'\n",
-		sub->tree->endpoint ? ast_sorcery_object_get_id(sub->tree->endpoint) : "Unknown",
+		sub->tree && sub->tree->endpoint ? ast_sorcery_object_get_id(sub->tree->endpoint) : "Unknown",
 		sub->resource);
 
 	ast_free(sub->body_text);

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b79c915ec216dc00c13c1e4172137864a4bec85
Gerrit-Change-Number: 6928
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171030/7a42c60b/attachment.html>


More information about the asterisk-code-review mailing list