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

George Joseph asteriskteam at digium.com
Wed Feb 21 10:39:07 CST 2018


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

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 972ea0b..52d0fc0 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3953,7 +3953,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/8331
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15.2
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic2b63f6d4ae617c4c19dcdec2a7a6156b54fd15b
Gerrit-Change-Number: 8331
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/80cad5d9/attachment.html>


More information about the asterisk-code-review mailing list