[network-manager-openconnect] Handle string == NULL in gnome-keyring callback



commit 31a0e8b8cf78206cda34ab593ba90c3d28ebbc29
Author: Michael Stapelberg <michael stapelberg de>
Date:   Fri Jun 15 23:13:16 2012 +0200

    Handle string == NULL in gnome-keyring callback

 auth-dialog/main.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 1dd1a38..141f238 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -622,11 +622,13 @@ static char *find_form_answer(GHashTable *secrets, struct oc_auth_form *form,
 static void got_keyring_pw(GnomeKeyringResult result, const char *string, gpointer userdata)
 {
 	ui_fragment_data *data = (ui_fragment_data*)userdata;
-	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);
+	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);
+	}
 
 	/* zero the find request so that we donât attempt to cancel it when
 	 * closing the dialog */



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