[asterisk-commits] res pjsip transport websocket: Add NULL check in get write t... (asterisk[14])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 14 15:28:40 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5832 )

Change subject: res_pjsip_transport_websocket: Add NULL check in get_write_timeout
......................................................................

res_pjsip_transport_websocket: Add NULL check in get_write_timeout

Added check for NULL return value when calling
ast_sorcery_retrieve_by_id in function get_write_timeout

ASTERISK-27046

Change-Id: I9357717278da631c3a1cb502c412693929b0cb41
---
M res/res_pjsip_transport_websocket.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c
index b3e63fc..cdda8c1 100644
--- a/res/res_pjsip_transport_websocket.c
+++ b/res/res_pjsip_transport_websocket.c
@@ -302,10 +302,14 @@
 
 		for (; (transport_state = ao2_iterator_next(&it_transport_states)); ao2_cleanup(transport_state)) {
 			struct ast_sip_transport *transport;
+
 			if (transport_state->type != AST_TRANSPORT_WS && transport_state->type != AST_TRANSPORT_WSS) {
 				continue;
 			}
 			transport = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", transport_state->id);
+			if (!transport) {
+				continue;
+			}
 			ast_debug(5, "Found %s transport with write timeout: %d\n",
 				transport->type == AST_TRANSPORT_WS ? "WS" : "WSS",
 				transport->write_timeout);

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

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: merged
Gerrit-Change-Id: I9357717278da631c3a1cb502c412693929b0cb41
Gerrit-Change-Number: 5832
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Jørgen H <asterisk.org at hovland.cx>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170614/b4c90f01/attachment-0001.html>


More information about the asterisk-commits mailing list