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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be70eabab0e21b73e976f27878ab3f38ad936736;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 4392677e0e..60d997af4d 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -3887,7 +3887,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; }