mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
CLI: Address multiple issues.
* listen uses the variable `s` for the result from ast_poll() then overwrites it with the result of accept(). Create a separate variable poll_result to avoid confusion since ast_poll does not return a file descriptor. * Resolve fd leak that would occur if setsockopt failed in listen. * Reserve an extra byte while processing completion results from remote daemon. This fixes a bug where completion processing used strstr() on a string that was not '\0' terminated. This was no risk to the Asterisk daemon, the bug was only reachable the remote console process. * Resolve leak in handle_showchan when the channel is not found. * Multiple leaks and a deadlock in pbx_config CLI completion. * Fix leaks in "manager show command". Change-Id: I8f633ceb1714867ae30ef4e421858f77c14485a9
This commit is contained in:
13
main/cli.c
13
main/cli.c
@@ -1496,17 +1496,20 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
|
||||
return CLI_FAILURE;
|
||||
}
|
||||
|
||||
output = ast_str_create(8192);
|
||||
if (!output) {
|
||||
return CLI_FAILURE;
|
||||
}
|
||||
|
||||
chan = ast_channel_get_by_name(a->argv[3]);
|
||||
if (!chan) {
|
||||
ast_cli(a->fd, "%s is not a known channel\n", a->argv[3]);
|
||||
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
|
||||
output = ast_str_create(8192);
|
||||
if (!output) {
|
||||
ast_channel_unref(chan);
|
||||
|
||||
return CLI_FAILURE;
|
||||
}
|
||||
|
||||
now = ast_tvnow();
|
||||
ast_channel_lock(chan);
|
||||
|
||||
|
Reference in New Issue
Block a user