diff options
author | Florian Schmaus <flo@geekplace.eu> | 2020-03-24 11:49:27 +0300 |
---|---|---|
committer | Florian Schmaus <flo@geekplace.eu> | 2020-03-24 11:49:27 +0300 |
commit | 282f95b3fc656708505806772b27f18b6cabbaea (patch) | |
tree | 0b53392b322b7830db410f82510acd51101ad13d | |
parent | bb8f359b1f5e87c889eed2e3814720cead24f9ae (diff) |
Fix null pointer dereference in remmina_main_quickconnect
gtk_combo_box_text_get_active_text() may returns NULL which then would
be handed as first argument to strcmp() causing a segmentation fault.
(gdb) bt
at /usr/src/debug/net-misc/remmina-1.4.1/Remmina-v1.4.1/src/remmina_main.c:1053
at
/usr/src/debug/net-misc/remmina-1.4.1/Remmina-v1.4.1/src/remmina_main.c:1077
(gdb) f 1
at /usr/src/debug/net-misc/remmina-1.4.1/Remmina-v1.4.1/src/remmina_main.c:1053
1053 if (strcmp(qcp, remmina_pref.last_quickconnect_protocol) != 0) {
(gdb) p qcp
$4 = (gchar *) 0x0
Signed-off-by: Florian Schmaus <flo@geekplace.eu>
-rw-r--r-- | src/remmina_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remmina_main.c b/src/remmina_main.c index e065aed37..644d9f856 100644 --- a/src/remmina_main.c +++ b/src/remmina_main.c @@ -1050,7 +1050,7 @@ static gboolean remmina_main_quickconnect(void) /* Save quick connect protocol if different from the previuous one */ qcp = gtk_combo_box_text_get_active_text(remminamain->combo_quick_connect_protocol); - if (strcmp(qcp, remmina_pref.last_quickconnect_protocol) != 0) { + if (qcp && strcmp(qcp, remmina_pref.last_quickconnect_protocol) != 0) { g_free(remmina_pref.last_quickconnect_protocol); remmina_pref.last_quickconnect_protocol = g_strdup(qcp); remmina_pref_save(); |