[Asterisk-code-review] res pjsip transport websocket: Add NULL check in get write t... (asterisk[13])
Jenkins2
asteriskteam at digium.com
Wed Jun 14 15:15:56 CDT 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5831 )
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 1b9d616..dd3922c 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/5831
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I9357717278da631c3a1cb502c412693929b0cb41
Gerrit-Change-Number: 5831
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-code-review/attachments/20170614/3c36ee8d/attachment.html>
More information about the asterisk-code-review
mailing list