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

Corey Farrell asteriskteam at digium.com
Fri Oct 27 13:52:52 CDT 2017


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/6927


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/6927/1

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/6927
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b79c915ec216dc00c13c1e4172137864a4bec85
Gerrit-Change-Number: 6927
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171027/867d0200/attachment.html>


More information about the asterisk-code-review mailing list