mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 04:00:32 +01:00
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:
parent
5f073ece4b
commit
a2cd94f83f
1 changed files with 8 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue