From: George Joseph Date: Tue, 6 Feb 2018 17:21:32 +0000 (-0700) Subject: AST-2018-005: Add a check for NULL tdata in ast_sip_failover_request X-Git-Tag: 15.3.0-rc1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8add33919eacc579a95c811a7f89cf672e7829f;p=thirdparty%2Fasterisk.git AST-2018-005: Add a check for NULL tdata in ast_sip_failover_request It was discovered that there are some corner cases where a pjsip tsx might have no last_tx so calling ast_sip_failover_request with a NULL last_tx as its tdata would cause a crash. ASTERISK-27618 Reported By: Sandro Gauci Change-Id: Ic2b63f6d4ae617c4c19dcdec2a7a6156b54fd15b --- diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 62d282b755..8789d4d131 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -4017,7 +4017,8 @@ int ast_sip_failover_request(pjsip_tx_data *tdata) { pjsip_via_hdr *via; - if (!tdata->dest_info.addr.count || (tdata->dest_info.cur_addr == tdata->dest_info.addr.count - 1)) { + if (!tdata || !tdata->dest_info.addr.count + || (tdata->dest_info.cur_addr == tdata->dest_info.addr.count - 1)) { /* No more addresses to try */ return 0; }