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

Richard Mudgett asteriskteam at digium.com
Mon Feb 12 20:57:32 CST 2018


Richard Mudgett has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/00/8200/1

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: newchange
Gerrit-Change-Id: Id1d0f0fa4ec94e81b332b2973d93e5a14bb4cc97
Gerrit-Change-Number: 8200
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180212/85508a0b/attachment.html>


More information about the asterisk-code-review mailing list