wifi: ignore zero-length SSIDs in internal wifi code

Should never get these, and if we do, we should ignore them by
leaving the SSID as NULL.
This commit is contained in:
Dan Williams 2011-05-18 10:30:08 -05:00
parent 5f073ece4b
commit a2cd94f83f

View file

@ -863,9 +863,14 @@ nm_ap_set_ssid (NMAccessPoint *ap, const GByteArray * ssid)
}
if (ssid) {
priv->ssid = g_byte_array_sized_new (ssid->len);
priv->ssid->len = ssid->len;
memcpy (priv->ssid->data, ssid->data, ssid->len);
/* Should never get zero-length SSIDs */
g_warn_if_fail (ssid->len > 0);
if (ssid->len)
priv->ssid = g_byte_array_sized_new (ssid->len);
priv->ssid->len = ssid->len;
memcpy (priv->ssid->data, ssid->data, ssid->len);
}
}
g_object_notify (G_OBJECT (ap), NM_AP_SSID);