diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-04 23:24:56 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-04 23:24:56 +0000 |
commit | 8e4b2b7d2166c2ab4ff5ce0fdda3413e645decce (patch) | |
tree | edb642bccdae0f1807ed7793a7d4d12646156690 /main | |
parent | 701a8a40c28ea67ef1c76d0838f4a0a9975da423 (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: http://svn.digium.com/svn/asterisk/trunk@105864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/manager.c | 12 |
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); |