From e28f39b7e93565bb54b6c75de1e588d952caba11 Mon Sep 17 00:00:00 2001 From: Shital Jaju Date: Thu, 30 Jan 2014 13:44:07 +0200 Subject: [PATCH] nl80211: Verify that ifindex attribute is included in survey This checks if the NL80211_ATTR_IFINDEX attribute is present before trying to get the value of interface index. Signed-hostap: Shital Jaju --- src/drivers/driver_nl80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 646d3f830..90a73f719 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -10619,6 +10619,9 @@ static int survey_handler(struct nl_msg *msg, void *arg) nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL); + if (!tb[NL80211_ATTR_IFINDEX]) + return NL_SKIP; + ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]); if (!tb[NL80211_ATTR_SURVEY_INFO])