Hi Jouni and Johannes,<div><br></div><div>Yes, I am trying to fix a bug related to generating random WPS ssid for each band, and thought this kind of change maybe necessary even without that random WPS ssid modification.</div>
<div>However, I seems to misunderstand how to use that SSID buffer. I will check it more.</div><div>Thanks for your responses. :)</div><div><br></div><div><br><br><div class="gmail_quote">
2011/12/10 Jouni Malinen <span dir="ltr"><<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Fri, Dec 09, 2011 at 01:10:10PM +0800, <a href="mailto:jungwalk@gmail.com" target="_blank">jungwalk@gmail.com</a> wrote:<br>
> It is better to reset the ssid in WPS first before it is replaced with the one in<br>
> credential in case the length of ssid in credential is longer than wps->ssid.<br>
<br>
</div>Are you trying to fix a bug that addresses some noticeable issue?<br>
<div><br>
> @@ -318,6 +318,7 @@ static int hapd_wps_cred_cb(struct hostapd_data *hapd, void *ctx)<br>
</div><div>> + os_memset(hapd->wps->ssid, 0, HOSTAPD_MAX_SSID_LEN);<br>
> os_memcpy(hapd->wps->ssid, cred->ssid, cred->ssid_len);<br>
> hapd->wps->ssid_len = cred->ssid_len;<br>
<br>
</div>Like Johannes pointed out, this should not really result in any real<br>
change in actual behavior. If it does, there is likely a real bug<br>
somewhere else and that should be fixed. The SSID buffer is used as an<br>
arbitrary binary array of ssid_len octets and as such, there is no need<br>
to null-terminate it - the extra octets in the buffer are ignored.<br>
<font color="#888888"><br>
--<br>
Jouni Malinen PGP id EFC895FA<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com" target="_blank">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</font></blockquote></div><br></div>