summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2018-02-11 15:27:49 -0600
committerRichard Mudgett <rmudgett@digium.com>2018-02-12 20:57:57 -0600
commit8372138cce10cef1d1a9c94c71df483ebdbe5f92 (patch)
tree714a4159b87ea1dc876d5c2513920bca24780b35 /channels
parent0461286123e3ab201374f8b8a2435ed6006b7a5a (diff)
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
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fa9899027..acf5a147e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -27425,7 +27425,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