diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-11-13 22:00:40 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-11-13 22:00:40 +0000 |
commit | 01a12c4d5e73052b7acbfbad6b9226e7185ff814 (patch) | |
tree | 4fae27b4c3a74fcc732ef7131d4bb7a2eb64b9bb /contrib | |
parent | 0ecbaa400e9bc3ee42032981fc8bdd614beace6b (diff) |
libiwinfo: clear buffer in nl80211_phy2ifname(), prevents running operations against the wrong phy if no interfaces are found (#347)
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/package/iwinfo/src/iwinfo_nl80211.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_nl80211.c b/contrib/package/iwinfo/src/iwinfo_nl80211.c index a27ed02e1..d00d26b0a 100644 --- a/contrib/package/iwinfo/src/iwinfo_nl80211.c +++ b/contrib/package/iwinfo/src/iwinfo_nl80211.c @@ -452,6 +452,8 @@ static char * nl80211_phy2ifname(const char *ifname) else if (!strncmp(ifname, "radio", 5)) phyidx = atoi(&ifname[5]); + memset(nif, 0, sizeof(nif)); + if (phyidx > -1) { if ((d = opendir("/sys/class/net")) != NULL) |