From: Richard Mudgett Date: Sun, 11 Feb 2018 21:27:49 +0000 (-0600) Subject: chan_sip.c: Fix crash processing CANCEL. X-Git-Tag: 13.20.0-rc1~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba63dad12dd07252886d8e69e2d1d3ee5fc8d39e;p=thirdparty%2Fasterisk.git 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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7a94517c4d..563cea886b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -27207,7 +27207,7 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req) } 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