[PATCH] Reset the ssid in wps before being replaced with the one in credential.

Johannes Berg johannes at sipsolutions.net
Fri Dec 9 06:34:40 EST 2011


On Fri, 2011-12-09 at 13:10 +0800, jungwalk at gmail.com wrote:
> From: Spencer Chang <jungwalk at gmail.com>
> 
> It is better to reset the ssid in WPS first before it is replaced with the one in
> credential in case the length of ssid in credential is longer than wps->ssid.

> +	os_memset(hapd->wps->ssid, 0, HOSTAPD_MAX_SSID_LEN);
>  	os_memcpy(hapd->wps->ssid, cred->ssid, cred->ssid_len);
>  	hapd->wps->ssid_len = cred->ssid_len;

That seems completely useless, in particular when it's longer since then
it will partially overwrite it anyway. They are binary data, not
strings, after all.

johannes



More information about the HostAP mailing list