[PATCH v2 4/7] Handle string == NULL in gnome-keyring callback (cherry picked from commit 31a0e8b8cf78206cda34ab593ba90c3d28ebbc29)



Signed-off-by: Murilo Opsfelder Araujo <muriloo linux vnet ibm com>

Conflicts:
	auth-dialog/main.c
---
 auth-dialog/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index e69b618..a256bda 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -665,12 +665,14 @@ static char *find_form_answer(struct oc_auth_form *form, struct oc_form_opt *opt
 static void got_keyring_pw(GnomeKeyringResult result, const char *string, gpointer userdata)
 {
 	ui_fragment_data *data = (ui_fragment_data*)userdata;
+	if (string != NULL) {
 		if (data->entry) {
 			if (g_ascii_strncasecmp("", gtk_entry_get_text(GTK_ENTRY(data->entry)), 0) == 0)
 				gtk_entry_set_text(GTK_ENTRY(data->entry), string);
 		} else
 			data->entry_text = g_strdup (string);
 	}
+}
 
 /* This part for processing forms from openconnect directly, rather than
    through the SSL UI abstraction (which doesn't allow 'select' options) */
@@ -769,6 +771,7 @@ static int nm_process_auth_form (void *cbdata, struct oc_auth_form *form)
 		while (!g_queue_is_empty (ui_data->form_entries)) {
 			ui_fragment_data *data;
 			data = g_queue_pop_tail (ui_data->form_entries);
+
 			if (data->entry_text) {
 				data->opt->value = data->entry_text;
 
-- 
1.8.0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]