aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/blacklist.c
diff options
context:
space:
mode:
authorSasha Levitskiy <sanek@google.com>2012-11-01 18:41:27 (GMT)
committerJouni Malinen <j@w1.fi>2012-11-01 18:41:27 (GMT)
commit5ff2c7faedd13dfd27659181b5b156171e875847 (patch)
tree40409122e99c3d93f12493d09935bb6b8664b94e /wpa_supplicant/blacklist.c
parentb363121a208e3d18fe80682430a5f50cefaa3595 (diff)
downloadhostap-5ff2c7faedd13dfd27659181b5b156171e875847.zip
hostap-5ff2c7faedd13dfd27659181b5b156171e875847.tar.gz
hostap-5ff2c7faedd13dfd27659181b5b156171e875847.tar.bz2
Add parameter checking and error reporting to wpa_blacklist API
Signed-off-by: Sasha Levitskiy <sanek@google.com>
Diffstat (limited to 'wpa_supplicant/blacklist.c')
-rw-r--r--wpa_supplicant/blacklist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wpa_supplicant/blacklist.c b/wpa_supplicant/blacklist.c
index fa8014c..2e01e7f 100644
--- a/wpa_supplicant/blacklist.c
+++ b/wpa_supplicant/blacklist.c
@@ -23,6 +23,9 @@ struct wpa_blacklist * wpa_blacklist_get(struct wpa_supplicant *wpa_s,
{
struct wpa_blacklist *e;
+ if (wpa_s == NULL || bssid == NULL)
+ return NULL;
+
e = wpa_s->blacklist;
while (e) {
if (os_memcmp(e->bssid, bssid, ETH_ALEN) == 0)
@@ -54,6 +57,9 @@ int wpa_blacklist_add(struct wpa_supplicant *wpa_s, const u8 *bssid)
{
struct wpa_blacklist *e;
+ if (wpa_s == NULL || bssid == NULL)
+ return -1;
+
e = wpa_blacklist_get(wpa_s, bssid);
if (e) {
e->count++;
@@ -87,6 +93,9 @@ int wpa_blacklist_del(struct wpa_supplicant *wpa_s, const u8 *bssid)
{
struct wpa_blacklist *e, *prev = NULL;
+ if (wpa_s == NULL || bssid == NULL)
+ return -1;
+
e = wpa_s->blacklist;
while (e) {
if (os_memcmp(e->bssid, bssid, ETH_ALEN) == 0) {