diff options
author | Andrey Gusakov <andrey.gusakov@cogentembedded.com> | 2014-08-11 14:01:41 +0400 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-08-13 08:30:56 +0200 |
commit | eecf576fa975b50f5e811fdefe30ea9cfee3b831 (patch) | |
tree | a769570bd8ceb1545dde70375b78feb403978f33 /src | |
parent | 58c76ccfd1e475dbbf7b113b0ab8a2f5149d0ae3 (diff) |
wifi: fix possible null-pointer dereference on sta_mac
p->sp->sta_mac is not mandatory set so check it before accessing it.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/wifi/wifid-supplicant.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wifi/wifid-supplicant.c b/src/wifi/wifid-supplicant.c index e478b64..2d252fc 100644 --- a/src/wifi/wifid-supplicant.c +++ b/src/wifi/wifid-supplicant.c @@ -115,7 +115,7 @@ static struct supplicant_peer *find_peer_by_any_mac(struct supplicant *s, struct peer *p; LINK_FOREACH_PEER(p, s->l) { - if (!strcmp(p->p2p_mac, mac) || !strcmp(p->sp->sta_mac, mac)) + if (!strcmp(p->p2p_mac, mac) || (p->sp->sta_mac && !strcmp(p->sp->sta_mac, mac))) return p->sp; } |