libnm-util: do not assert on buggy drivers with no WEP cipher capabilities

The crash happens with ipw2200, kernel 3.2.0 when a user tries to connect
to a hidden network using nm-applet.
g_assert (have_ap); is hit in 'case NMU_SEC_STATIC_WEP:' branch.

Reported by Mathieu Trudel-Lapierre.
See also:
(lp:908516)
(lp:908380)
This commit is contained in:
Jiří Klimeš 2012-03-13 15:37:11 +01:00
parent 19ffe0783f
commit bb6da998b2

View file

@ -1243,6 +1243,8 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|| ((type == NMU_SEC_LEAP) && !adhoc)) {
if (wifi_caps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104))
return TRUE;
else
return FALSE;
}
}