Fix a few overflow problems

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3471 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Paul Tinsley 2006-11-28 20:20:22 +00:00
parent e15479daae
commit a85ec77f99
1 changed files with 3 additions and 3 deletions

View File

@ -579,9 +579,9 @@ static switch_status_t show_function(char *cmd, switch_core_session_t *session,
holder.print_title = 0; holder.print_title = 0;
if ((cmdname = strchr(cmd, ' ')) != 0) { if ((cmdname = strchr(cmd, ' ')) != 0) {
*cmdname++ = '\0'; *cmdname++ = '\0';
sprintf (sql, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname); snprintf (sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
} else { } else {
sprintf (sql, "select name, syntax, description from interfaces where type = 'api'"); snprintf (sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api'");
} }
} else { } else {
stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax); stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax);
@ -633,7 +633,7 @@ static switch_status_t help_function(char *cmd, switch_core_session_t *session,
sprintf (showcmd, "help"); sprintf (showcmd, "help");
all = 1; all = 1;
} else { } else {
sprintf (showcmd, "help %s", cmd); snprintf(showcmd, sizeof(showcmd) -1, "help %s", cmd);
} }
if (all) { if (all) {