[Asterisk-code-review] chan sip.c: Fix crash processing CANCEL. (asterisk[13])

Jenkins2 asteriskteam at digium.com
Tue Feb 13 08:09:20 CST 2018


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

Change subject: chan_sip.c: Fix crash processing CANCEL.
......................................................................

chan_sip.c: Fix crash processing CANCEL.

Check if initreq data string exists before using it when processing a
CANCEL request.

ASTERISK-27666

Change-Id: Id1d0f0fa4ec94e81b332b2973d93e5a14bb4cc97
---
M channels/chan_sip.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7a94517..563cea8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -27207,7 +27207,7 @@
 	} else {
 		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 	}
-	if (ast_str_strlen(p->initreq.data) > 0) {
+	if (p->initreq.data && ast_str_strlen(p->initreq.data) > 0) {
 		struct sip_pkt *pkt, *prev_pkt;
 		/* If the CANCEL we are receiving is a retransmission, and we already have scheduled
 		 * a reliable 487, then we don't want to schedule another one on top of the previous

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Id1d0f0fa4ec94e81b332b2973d93e5a14bb4cc97
Gerrit-Change-Number: 8200
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.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/20180213/d4f1ed0a/attachment.html>


More information about the asterisk-code-review mailing list