mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Safe string handling on get password
This commit is contained in:
parent
3970a4d736
commit
35d224a221
@ -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)
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user