Re: WPS: add null-terminator to ssid

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

 



On Thu, Nov 16, 2023 at 12:54:15PM +0300, Alexander Pogudaev wrote:
> diff --git a/wpa_supplicant/wps_supplicant.c
> +++ b/wpa_supplicant/wps_supplicant.c
> -	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;
>  	}

Could you please clarify (in the commit message) why this would be
needed?

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
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