[asterisk-commits] res pjsip pubsub: Fix crash on destruction of empty subscrip... (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 25 10:12:10 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: res_pjsip_pubsub: Fix crash on destruction of empty subscription tree.
......................................................................


res_pjsip_pubsub: Fix crash on destruction of empty subscription tree.

If an old persistent subscription is recreated but then immediately
destroyed because it is out of date, the subscription tree will have no
leaf subscriptions on it. This was resulting in a crash when attempting
to destroy the subscription tree.

A simple NULL check fixes this problem.

Change-Id: I85570b9e2bcc7260a3fe0ad85904b2a9bf36d2ac
---
M res/res_pjsip_pubsub.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 371cceb..87712cf 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1079,6 +1079,10 @@
 {
 	int i;
 
+	if (!root) {
+		return;
+	}
+
 	for (i = 0; i < AST_VECTOR_SIZE(&root->children); ++i) {
 		struct ast_sip_subscription *child;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85570b9e2bcc7260a3fe0ad85904b2a9bf36d2ac
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list