1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Safe string handling on get password

This commit is contained in:
James Booth 2012-02-19 20:16:33 +00:00
parent 3970a4d736
commit 35d224a221
2 changed files with 4 additions and 4 deletions

View File

@ -30,8 +30,8 @@ int handle_start_command(char *inp)
}
// trim input and take a copy
char inp_cpy[100];
inp = trim(inp);
char inp_cpy[strlen(inp) + 1];
strcpy(inp_cpy, inp);
// get the command "/command"
@ -70,8 +70,8 @@ int handle_command(char *inp)
if (inp[0] == '/') {
// trim input and take a copy
char inp_cpy[100];
inp = trim(inp);
char inp_cpy[strlen(inp) + 1];
strcpy(inp_cpy, inp);
// get the command "/command"
@ -131,7 +131,7 @@ static int _cmd_start_connect(char *inp)
status_bar_get_password();
status_bar_refresh();
char passwd[20];
char passwd[21];
inp_get_password(passwd);
int connect_status = jabber_connect(user, passwd);
if (connect_status == CONNECTING)

View File

@ -84,7 +84,7 @@ void inp_get_password(char *passwd)
{
wclear(inp_win);
noecho();
mvwgetstr(inp_win, 0, 1, passwd);
mvwgetnstr(inp_win, 0, 1, passwd, 20);
wmove(inp_win, 0, 1);
echo();
status_bar_clear();