[gnome-bluetooth] Fix crasher when selecting a non-resolved device



commit 61488a5a51261e21614444024fcc7c7eaf437910
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jun 29 22:51:15 2009 +0100

    Fix crasher when selecting a non-resolved device
    
    If we selected a device in the wizard before its name was resolved,
    we would crash checking whether the device name matched.

 wizard/pin.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/wizard/pin.c b/wizard/pin.c
index cb064bf..0b413c6 100644
--- a/wizard/pin.c
+++ b/wizard/pin.c
@@ -88,7 +88,7 @@ pin_db_parse_start_tag (GMarkupParseContext *ctx,
 			if (g_str_has_prefix (pdata->address, *attr_values) == FALSE)
 				return;
 		} else if (g_str_equal (*attr_names, "name")) {
-			if (g_str_equal (*attr_values, pdata->name) == FALSE)
+			if (g_strcmp0 (*attr_values, pdata->name) != 0)
 				return;
 		} else if (g_str_equal (*attr_names, "pin")) {
 			if (g_str_has_prefix (*attr_values, MAX_DIGITS_PIN_PREFIX) != FALSE) {
@@ -115,6 +115,8 @@ get_pincode_for_device (guint type, const char *address, const char *name, guint
 	gsize buf_len;
 	GError *err = NULL;
 
+	g_return_val_if_fail (address != NULL, NULL);
+
 	/* Load the PIN database and split it in lines */
 	if (!g_file_get_contents(PIN_CODE_DB, &buf, &buf_len, NULL)) {
 		char *filename;



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