mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
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>
This commit is contained in:
parent
58c76ccfd1
commit
eecf576fa9
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ static struct supplicant_peer *find_peer_by_any_mac(struct supplicant *s,
|
||||||
struct peer *p;
|
struct peer *p;
|
||||||
|
|
||||||
LINK_FOREACH_PEER(p, s->l) {
|
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;
|
return p->sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue