diff options
author | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2021-07-14 02:58:36 +0300 |
---|---|---|
committer | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2021-07-14 02:58:36 +0300 |
commit | 45cb7885430c3504405bd8a729dc2f54849ec196 (patch) | |
tree | d6053bf83cf66eb355cbe868d6251be214ee5fa2 | |
parent | e0e34374519e6d8a48a083251e92688ea0e89719 (diff) |
Quick connect address validation
-rw-r--r-- | src/remmina_main.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/remmina_main.c b/src/remmina_main.c index 1b02296ea..b69abfda1 100644 --- a/src/remmina_main.c +++ b/src/remmina_main.c @@ -665,7 +665,7 @@ static void remmina_main_load_files() gtk_statusbar_push(remminamain->statusbar_main, context_id, buf); } -void remmina_main_load_files_cb() +void remmina_main_load_files_cb(GtkEntry *entry, char *string, gpointer user_data) { TRACE_CALL(__func__); remmina_main_load_files(); @@ -755,7 +755,6 @@ void remmina_main_on_action_connection_new(GSimpleAction *action, GVariant *para } static gboolean remmina_main_search_key_event (GtkWidget *search_entry, GdkEventKey *event, gpointer user_data) - { TRACE_CALL(__func__); if (event->keyval == GDK_KEY_Escape) { @@ -1132,6 +1131,16 @@ static gboolean remmina_main_quickconnect(void) remminafile = remmina_file_new(); server = g_strdup(gtk_entry_get_text(remminamain->entry_quick_connect_server)); + if (g_hostname_to_ascii(server) == NULL) + return FALSE; + /* If server contain /, e.g. vnc://, it won't connect + * We could search for an array of invalid characters, but + * it's better to find a way to correctly parse and validate addresses + */ + if (g_strrstr(server, "/") != NULL) + return FALSE; + //if (g_str_has_suffix (server, "/")) + //return FALSE; if (is_empty(server)) return FALSE; |