summaryrefslogtreecommitdiff
path: root/src/platform/wifi
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-01 13:07:43 +0200
committerThomas Haller <thaller@redhat.com>2019-05-07 20:58:17 +0200
commit3784a2a2ec6f8c6307f45bae12c17630b7d70b0a (patch)
tree4400a8aa23768d4ade112067c81e54501aa00a9f /src/platform/wifi
parent36d6aa3bcd97f2144e8f435249ed8f3cb709ae43 (diff)
downloadNetworkManager-3784a2a2ec6f8c6307f45bae12c17630b7d70b0a.tar.gz
platform: assert for out-of-memory in netlink code
These lines can be reached if the allocated buffer is too small to hold the netlink message. That is actually a bug that we need to fix. Assert.
Diffstat (limited to 'src/platform/wifi')
-rw-r--r--src/platform/wifi/nm-wifi-utils-nl80211.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/platform/wifi/nm-wifi-utils-nl80211.c b/src/platform/wifi/nm-wifi-utils-nl80211.c
index 4f7ede9757..6a8525ed4b 100644
--- a/src/platform/wifi/nm-wifi-utils-nl80211.c
+++ b/src/platform/wifi/nm-wifi-utils-nl80211.c
@@ -103,7 +103,7 @@ _nl80211_alloc_msg (int id, int ifindex, int phy, guint32 cmd, guint32 flags)
return g_steal_pointer (&msg);
nla_put_failure:
- return NULL;
+ g_return_val_if_reached (NULL);
}
static struct nl_msg *
@@ -250,7 +250,7 @@ wifi_nl80211_set_mode (NMWifiUtils *data, const NM80211Mode mode)
return err >= 0;
nla_put_failure:
- return FALSE;
+ g_return_val_if_reached (FALSE);
}
static gboolean
@@ -267,7 +267,7 @@ wifi_nl80211_set_powersave (NMWifiUtils *data, guint32 powersave)
return err >= 0;
nla_put_failure:
- return FALSE;
+ g_return_val_if_reached (FALSE);
}
static int
@@ -365,7 +365,7 @@ wifi_nl80211_set_wake_on_wlan (NMWifiUtils *data, NMSettingWirelessWakeOnWLan wo
return err >= 0;
nla_put_failure:
- return FALSE;
+ g_return_val_if_reached (FALSE);
}
/* @divisor: pass what value @xbm should be divided by to get dBm */
@@ -642,7 +642,7 @@ nl80211_get_ap_info (NMWifiUtilsNl80211 *self,
return;
nla_put_failure:
- return;
+ g_return_if_reached ();
}
static guint32
@@ -695,7 +695,7 @@ wifi_nl80211_indicate_addressing_running (NMWifiUtils *data, gboolean running)
return err >= 0;
nla_put_failure:
- return FALSE;
+ g_return_val_if_reached (FALSE);
}
struct nl80211_device_info {