summaryrefslogtreecommitdiff
path: root/main/manager.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-03-04 23:24:56 +0000
committerMark Michelson <mmichelson@digium.com>2008-03-04 23:24:56 +0000
commit6cf605940252204bd74d4b0cf88d1ccb16fd7eb1 (patch)
treeedb642bccdae0f1807ed7793a7d4d12646156690 /main/manager.c
parent7007c565fe84b1abe5520a3d4be8d60ce9492a3d (diff)
There are several places in manager.c where BUFSIZ is used for a buffer
which will contain nowhere near that amount of data. This makes these buffers more reasonably sized. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/manager.c b/main/manager.c
index da583155d..51232c2c3 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -1901,7 +1901,7 @@ static int action_redirect(struct mansession *s, const struct message *m)
/* XXX watch out, possible deadlock - we are trying to get two channels!!! */
chan = ast_get_channel_by_name_locked(name);
if (!chan) {
- char buf[BUFSIZ];
+ char buf[256];
snprintf(buf, sizeof(buf), "Channel does not exist: %s", name);
astman_send_error(s, m, buf);
return 0;
@@ -2554,12 +2554,12 @@ static int manager_modulecheck(struct mansession *s, const struct message *m)
int res;
const char *module = astman_get_header(m, "Module");
const char *id = astman_get_header(m, "ActionID");
- char idText[BUFSIZ];
+ char idText[256];
const char *version;
- char filename[BUFSIZ/2];
+ char filename[PATH_MAX];
char *cut;
- snprintf(filename, sizeof(filename), module);
+ ast_copy_string(filename, module, sizeof(filename));
if ((cut = strchr(filename, '.'))) {
*cut = '\0';
} else {
@@ -2698,7 +2698,7 @@ static int process_message(struct mansession *s, const struct message *m)
AST_RWLIST_UNLOCK(&actions);
if (!tmp) {
- char buf[BUFSIZ];
+ char buf[512];
snprintf(buf, sizeof(buf), "Invalid/unknown command: %s. Use Action: ListCommands to show available commands.", action);
ast_mutex_lock(&s->__lock);
astman_send_error(s, m, buf);
@@ -3031,7 +3031,7 @@ int ast_manager_unregister(char *action)
static int manager_state_cb(char *context, char *exten, int state, void *data)
{
/* Notify managers of change */
- char hint[BUFSIZ];
+ char hint[512];
ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, context, exten);
manager_event(EVENT_FLAG_CALL, "ExtensionStatus", "Exten: %s\r\nContext: %s\r\nHint: %s\r\nStatus: %d\r\n", exten, context, hint, state);