summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2018-02-06 10:21:32 -0700
committerGeorge Joseph <gjoseph@digium.com>2018-02-21 08:14:40 -0700
commitc53d8dcb68751f499df31f0c07c3be7ccd02fa68 (patch)
tree93459455b2d3a61c0fe50e2f9c110e0564e723a5 /res
parenta1e6320c4a1c08d17c920b5c39ef0bb055042a4a (diff)
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
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 7b59035c2..79e6cc20b 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -4173,7 +4173,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;
}