WPS: add null-terminator to ssid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Alexander Pogudaev <apogudaev@xxxxxxxx>
---
 wpa_supplicant/wps_supplicant.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 220a5f8b5..81eb35d40 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -488,9 +488,10 @@ static int wpa_supplicant_wps_cred(void *ctx,
 	ssid->wps_run = wpa_s->wps_run;
  	os_free(ssid->ssid);
-	ssid->ssid = os_malloc(cred->ssid_len);
+	ssid->ssid = os_malloc(cred->ssid_len + 1);
 	if (ssid->ssid) {
 		os_memcpy(ssid->ssid, cred->ssid, cred->ssid_len);
+		ssid->ssid[cred->ssid_len] = '\0';
 		ssid->ssid_len = cred->ssid_len;
 	}
 -- 2.42.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux