]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Verify that ifindex attribute is included in survey
authorShital Jaju <shitalj@broadcom.com>
Thu, 30 Jan 2014 11:44:07 +0000 (13:44 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 30 Jan 2014 11:44:07 +0000 (13:44 +0200)
This checks if the NL80211_ATTR_IFINDEX attribute is present before
trying to get the value of interface index.

Signed-hostap: Shital Jaju <shitalj@broadcom.com>

src/drivers/driver_nl80211.c

index 646d3f8309033ed72fcadd2ab89a81618c75ae51..90a73f7196d301927167ec73a66e61c85040fc1b 100644 (file)
@@ -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])