summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/devices/nm-device-wifi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/devices/nm-device-wifi.c b/src/devices/nm-device-wifi.c
index 855c1e7a51..6c19d6206e 100644
--- a/src/devices/nm-device-wifi.c
+++ b/src/devices/nm-device-wifi.c
@@ -2313,7 +2313,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
*/
if (devstate == NM_DEVICE_STATE_CONFIG) {
NMAccessPoint *ap = nm_device_wifi_get_activation_ap (self);
- const GByteArray *ssid = nm_ap_get_ssid (ap);
+ const GByteArray *ssid = ap ? nm_ap_get_ssid (ap) : NULL;
nm_log_info (LOGD_DEVICE | LOGD_WIFI,
"Activation (%s/wireless) Stage 2 of 5 (Device Configure) "
@@ -2593,9 +2593,8 @@ supplicant_connection_timeout_cb (gpointer user_data)
g_assert (priv->mode == NM_802_11_MODE_INFRA);
ap = nm_device_wifi_get_activation_ap (self);
- g_assert (ap);
- if (priv->ssid_found && is_encrypted (ap, connection)) {
+ if (priv->ssid_found && ap && is_encrypted (ap, connection)) {
guint64 timestamp = 0;
gboolean new_secrets = TRUE;
@@ -2944,7 +2943,11 @@ act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason)
g_assert (req);
ap = nm_device_wifi_get_activation_ap (self);
- g_assert (ap);
+ if (!ap) {
+ nm_log_warn (LOGD_DEVICE | LOGD_WIFI, "act_stage2_config failed due to unexpected missing activation_ap. Abort");
+ *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT;
+ goto out;
+ }
connection = nm_act_request_get_connection (req);
g_assert (connection);
@@ -3102,7 +3105,6 @@ handle_ip_config_timeout (NMDeviceWifi *self,
}
ap = nm_device_wifi_get_activation_ap (self);
- g_assert (ap);
/* If IP configuration times out and it's a static WEP connection, that
* usually means the WEP key is wrong. WEP's Open System auth mode has
@@ -3111,7 +3113,7 @@ handle_ip_config_timeout (NMDeviceWifi *self,
* types (open, WPA, 802.1x, etc) if the secrets/certs were wrong the
* connection would have failed before IP configuration.
*/
- if (is_static_wep (ap, connection) && (may_fail == FALSE)) {
+ if (ap && is_static_wep (ap, connection) && (may_fail == FALSE)) {
/* Activation failed, we must have bad encryption key */
nm_log_warn (LOGD_DEVICE | LOGD_WIFI,
"Activation (%s/wireless): could not get IP configuration for "
@@ -3203,7 +3205,7 @@ activation_success_handler (NMDevice *dev)
/* If the AP isn't fake, it was found in the scan list and all its
* details are known.
*/
- if (!nm_ap_get_fake (ap))
+ if (!ap || !nm_ap_get_fake (ap))
goto done;
/* If the activate AP was fake, it probably won't have a BSSID at all.