config: Check SSID length before comparing protected SSIDs
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 11 Apr 2011 09:10:58 +0000 (11:10 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 11 Apr 2011 10:02:45 +0000 (12:02 +0200)
src/config.c

index 974643f..5303d64 100644 (file)
@@ -191,6 +191,9 @@ is_protected_service(struct connman_config_service *service)
                if (s->ssid == NULL || service->ssid == NULL)
                        continue;
 
+               if (s->ssid_len != service->ssid_len)
+                       continue;
+
                if (g_strcmp0(service->type, "wifi") == 0 &&
                        strncmp(s->ssid, service->ssid, s->ssid_len) == 0) {
                        return TRUE;