From patchwork Fri Dec 9 05:10:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Reset the ssid in wps before being replaced with the one in credential. Date: Thu, 08 Dec 2011 19:10:10 -0000 From: jungwalk@gmail.com X-Patchwork-Id: 130281 Message-Id: <1323407410-25072-1-git-send-email-jungwalk@gmail.com> To: hostap@lists.shmoo.com From: Spencer Chang 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. Signed-off-by: Spencer Chang --- src/ap/wps_hostapd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 817012e..42b22a2 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -318,6 +318,7 @@ static int hapd_wps_cred_cb(struct hostapd_data *hapd, void *ctx) if (hapd->conf->wps_cred_processing == 1) return 0; + 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; hapd->wps->encr_types = cred->encr_type;