[Asterisk-code-review] AST-2018-005: Add a check for NULL tdata in ast sip failover... (asterisk[master])

George Joseph asteriskteam at digium.com
Wed Feb 21 10:42:08 CST 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/8342 )

Change subject: AST-2018-005: Add a check for NULL tdata in ast_sip_failover_request
......................................................................

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
---
M res/res_pjsip.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jenkins2: Verified
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 7b59035..79e6cc2 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -4173,7 +4173,8 @@
 {
 	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;
 	}

-- 
To view, visit https://gerrit.asterisk.org/8342
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic2b63f6d4ae617c4c19dcdec2a7a6156b54fd15b
Gerrit-Change-Number: 8342
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180221/63e28726/attachment.html>


More information about the asterisk-code-review mailing list