From 8cc6c987a9baed90dbba530c83f42d08d4893c32 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 17 Jun 2014 12:28:53 -0700 Subject: [PATCH] GUAC-716: Stop password search if user input is detected. --- src/protocols/telnet/guac_handlers.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/protocols/telnet/guac_handlers.c b/src/protocols/telnet/guac_handlers.c index f68cb653..230a618f 100644 --- a/src/protocols/telnet/guac_handlers.c +++ b/src/protocols/telnet/guac_handlers.c @@ -60,9 +60,19 @@ int guac_telnet_client_key_handler(guac_client* client, int keysym, int pressed) guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data; guac_terminal* term = client_data->term; - /* Send key if not searching for password */ - if (client_data->password_regex == NULL) - guac_terminal_send_key(term, keysym, pressed); + /* Stop searching for password */ + if (client_data->password_regex != NULL) { + + guac_client_log_info(client, "Stopping password prompt search due to user input."); + + regfree(client_data->password_regex); + free(client_data->password_regex); + client_data->password_regex = NULL; + + } + + /* Send key */ + guac_terminal_send_key(term, keysym, pressed); return 0;