Bug 1068468 - Truncate ssid if its length of encoded to utf8 is longer than 32. r=chulee

--HG--
extra : amend_source : 7f41d7bf31c3152e75934731d36aead919371baa
This commit is contained in:
Kai-Zhen Li 2014-09-26 17:41:19 +08:00
parent 5264cdc15c
commit 642f337c64

View File

@ -3077,6 +3077,12 @@ WifiWorker.prototype = {
debug("Invalid SSID value.");
return null;
}
// Truncate ssid if its length of encoded to utf8 is longer than 32.
while (unescape(encodeURIComponent(ssid)).length > 32)
{
ssid = ssid.substring(0, ssid.length-1);
}
if (securityType != WIFI_SECURITY_TYPE_NONE &&
securityType != WIFI_SECURITY_TYPE_WPA_PSK &&
securityType != WIFI_SECURITY_TYPE_WPA2_PSK) {