From: Max Stepanov Date: Wed, 22 Jan 2014 14:05:47 +0000 (+0200) Subject: nl80211: Fix sizeof check in vendor command/event handling X-Git-Tag: hostap_2_1~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=080cc445df897592f493d33224f6c3ec01b4a821;p=thirdparty%2Fhostap.git nl80211: Fix sizeof check in vendor command/event handling Fix sizeof in a validity comparison of nl80211_vendor_cmd_info size. The incorrect version happened to work on 64-bit builds due the structure being eight octets, but this was incorrect and would not used with 32-bit builds. Signed-hostap: Max Stepanov --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0b8eed502..e648486fd 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3584,7 +3584,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) nla_for_each_nested(nl, tb[NL80211_ATTR_VENDOR_DATA], rem) { struct nl80211_vendor_cmd_info *vinfo; - if (nla_len(nl) != sizeof(vinfo)) { + if (nla_len(nl) != sizeof(*vinfo)) { wpa_printf(MSG_DEBUG, "nl80211: Unexpected vendor data info"); continue; } @@ -3600,7 +3600,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) nla_for_each_nested(nl, tb[NL80211_ATTR_VENDOR_EVENTS], rem) { struct nl80211_vendor_cmd_info *vinfo; - if (nla_len(nl) != sizeof(vinfo)) { + if (nla_len(nl) != sizeof(*vinfo)) { wpa_printf(MSG_DEBUG, "nl80211: Unexpected vendor data info"); continue; }