summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/iwinfo
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-07-22 14:49:52 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-07-22 14:49:52 +0000
commit7dc764e861dd704ce554f2f5275761e348b07c3c (patch)
tree5aed55cd3a5e854ed30c9778716b199ce7c8bb65 /contrib/package/iwinfo
parentff892ab41a3bce6b8043c2597d537cd803f517f9 (diff)
libiwinfo: fix segfaults in nl80211 hwmodelist and freqlist operations if called on a not existing phy
Diffstat (limited to 'contrib/package/iwinfo')
-rw-r--r--contrib/package/iwinfo/src/iwinfo_nl80211.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_nl80211.c b/contrib/package/iwinfo/src/iwinfo_nl80211.c
index 5828ee98de..468ad9d705 100644
--- a/contrib/package/iwinfo/src/iwinfo_nl80211.c
+++ b/contrib/package/iwinfo/src/iwinfo_nl80211.c
@@ -1438,7 +1438,7 @@ int nl80211_get_freqlist(const char *ifname, char *buf, int *len)
if( req )
{
res = nl80211_send(req);
- if( res )
+ if( res && res->attr[NL80211_ATTR_WIPHY_BANDS] )
{
nla_for_each_nested(band,
res->attr[NL80211_ATTR_WIPHY_BANDS], bands_remain)
@@ -1537,7 +1537,7 @@ int nl80211_get_hwmodelist(const char *ifname, int *buf)
if( req )
{
res = nl80211_send(req);
- if( res )
+ if( res && res->attr[NL80211_ATTR_WIPHY_BANDS] )
{
nla_for_each_nested(band,
res->attr[NL80211_ATTR_WIPHY_BANDS], bands_remain)