From 81ec93fdcc754a286faa410f470b2af401ccd1e4 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 16 Oct 2019 15:29:44 -0700 Subject: [PATCH] anqp: fix potential NULL pointer dereference --- src/anqp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/anqp.c b/src/anqp.c index a47530ab..5e867656 100644 --- a/src/anqp.c +++ b/src/anqp.c @@ -287,6 +287,9 @@ uint32_t anqp_request(uint32_t ifindex, const uint8_t *addr, uint32_t duration = 300; struct netdev *netdev = netdev_find(ifindex); + if (!netdev) + return 0; + /* * TODO: Netdev dependencies will eventually be removed so we need * another way to figure out wiphy capabilities.