hostapd: backport package from trunk r39765
[12.09/openwrt.git] / package / hostapd / patches / 420-fix_wps_pin_crash.patch
diff --git a/package/hostapd/patches/420-fix_wps_pin_crash.patch b/package/hostapd/patches/420-fix_wps_pin_crash.patch
new file mode 100644 (file)
index 0000000..130bd53
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
+       char *pos;
+       const char *pin_txt;
++      if (!hapd->wps)
++              return -1;
++
+       pos = os_strchr(txt, ' ');
+       if (pos)
+               *pos++ = '\0';