mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-14 22:08:28 +00:00
tcptls: when disabling a server port, we should set the accept_fd to -1.
If we don't set this to -1 if the structure can be potentially re-used
later then it's possible that we'll issue a close() on an unrelated file
descriptor, breaking asterisk in other interesting ways.
I believe this to be an unlikely scenario, but it costs nothing to be
safe.
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
(cherry picked from commit 4a637d6d11)
This commit is contained in:
committed by
Asterisk Development Team
parent
a6a5498b0d
commit
dafa9917ff
@@ -837,6 +837,7 @@ void ast_tcptls_server_start(struct ast_tcptls_session_args *desc)
|
|||||||
|
|
||||||
if (desc->accept_fd != -1) {
|
if (desc->accept_fd != -1) {
|
||||||
close(desc->accept_fd);
|
close(desc->accept_fd);
|
||||||
|
desc->accept_fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there's no new server, stop here */
|
/* If there's no new server, stop here */
|
||||||
|
|||||||
Reference in New Issue
Block a user