[Asterisk-code-review] chan sip.c: chan sip unstable with TLS after asterisk start ... (asterisk[16])
George Joseph
asteriskteam at digium.com
Mon Sep 24 10:44:11 CDT 2018
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10206 )
Change subject: chan_sip.c: chan_sip unstable with TLS after asterisk start or reloads
......................................................................
chan_sip.c: chan_sip unstable with TLS after asterisk start or reloads
Fixes random asterisk crash on start or reload with TLS phones.
ASTERISK-28034 #close
Reported-by: David Hajek
Change-Id: I2a859f97dc80c348e2fa56e918214ee29521c4ac
---
M channels/chan_sip.c
1 file changed, 6 insertions(+), 2 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Matthew Fredrickson: Looks good to me, approved
George Joseph: Approved for Submit
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e375bfe..5563a9a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2617,7 +2617,8 @@
ao2_lock(tcptls_session);
- if (!(th = ao2_t_find(threadt, &tmp, OBJ_POINTER, "ao2_find, getting sip_threadinfo in tcp helper thread")) ||
+ if (!tcptls_session->stream ||
+ !(th = ao2_t_find(threadt, &tmp, OBJ_POINTER, "ao2_find, getting sip_threadinfo in tcp helper thread")) ||
!(packet = ao2_alloc(sizeof(*packet), tcptls_packet_destructor)) ||
!(packet->data = ast_str_create(len))) {
goto tcptls_write_setup_error;
@@ -3139,7 +3140,7 @@
if (read(me->alert_pipe[0], &alert, sizeof(alert)) == -1) {
ast_log(LOG_ERROR, "read() failed: %s\n", strerror(errno));
- continue;
+ goto cleanup;
}
switch (alert) {
@@ -3157,10 +3158,13 @@
ast_log(LOG_WARNING, "Failure to write to tcp/tls socket\n");
}
ao2_t_ref(packet, -1, "tcptls packet sent, this is no longer needed");
+ } else {
+ goto cleanup;
}
break;
default:
ast_log(LOG_ERROR, "Unknown tcptls thread alert '%u'\n", alert);
+ goto cleanup;
}
}
}
--
To view, visit https://gerrit.asterisk.org/10206
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I2a859f97dc80c348e2fa56e918214ee29521c4ac
Gerrit-Change-Number: 10206
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: David Hajek <david.hajek at daktela.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
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/20180924/4d85096c/attachment.html>
More information about the asterisk-code-review
mailing list