aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-02-02 14:06:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-02-02 14:06:16 +0000
commitdef1af252823240f2043e88e79ea9e05d47c1cee (patch)
treed4c0c5190ba41db6eae2099464773fa29276a35c /package
parentafbffe9fcd7261cfcf8ff462ad81aea553b2241a (diff)
downloadupstream-def1af252823240f2043e88e79ea9e05d47c1cee.tar.gz
upstream-def1af252823240f2043e88e79ea9e05d47c1cee.tar.bz2
upstream-def1af252823240f2043e88e79ea9e05d47c1cee.zip
[package] iwinfo: fix segmentation fault when doing two consecutive scans through wpa_supplicant
Based on patch by Christian Kapeller <christian.kapeller@cmotion.eu> with one minor whitespace change and updated package version. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29992 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/iwinfo/Makefile2
-rw-r--r--package/iwinfo/src/iwinfo_nl80211.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/package/iwinfo/Makefile b/package/iwinfo/Makefile
index dae7470154..4f6bc1d363 100644
--- a/package/iwinfo/Makefile
+++ b/package/iwinfo/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
-PKG_RELEASE:=23
+PKG_RELEASE:=24
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
diff --git a/package/iwinfo/src/iwinfo_nl80211.c b/package/iwinfo/src/iwinfo_nl80211.c
index 4f3390fdbb..e8cfb902f0 100644
--- a/package/iwinfo/src/iwinfo_nl80211.c
+++ b/package/iwinfo/src/iwinfo_nl80211.c
@@ -387,10 +387,13 @@ static char * nl80211_wpactl_info(const char *ifname, const char *cmd,
goto out;
- send(sock, "ATTACH", 6, 0);
+ if (event)
+ {
+ send(sock, "ATTACH", 6, 0);
- if (nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0)
- goto out;
+ if (nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0)
+ goto out;
+ }
send(sock, cmd, strlen(cmd), 0);
@@ -405,7 +408,7 @@ static char * nl80211_wpactl_info(const char *ifname, const char *cmd,
break;
}
- if ((!event && buffer[0] != '<') || strstr(buffer, event))
+ if ((!event && buffer[0] != '<') || (event && strstr(buffer, event)))
break;
}