mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 454708 - storage-Legacy can throw when calling ConvertToUnicode. r=gavin
This commit is contained in:
parent
88bcb5a900
commit
d261d66277
@ -862,7 +862,11 @@ LoginManagerStorage_legacy.prototype = {
|
||||
|
||||
do {
|
||||
var hasMore = lineStream.readLine(line);
|
||||
try {
|
||||
line.value = this._utfConverter.ConvertToUnicode(line.value);
|
||||
} catch (e) {
|
||||
this.log("Bad UTF8 conversion: " + line.value);
|
||||
}
|
||||
|
||||
switch (parseState) {
|
||||
// Check file header
|
||||
|
@ -0,0 +1,10 @@
|
||||
#2e
|
||||
.
|
||||
https://FcK<63>.jp
|
||||
put_user_here
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
|
||||
*put_pw_here
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
https://FcK<63>.jp
|
||||
---
|
||||
.
|
@ -586,6 +586,33 @@ storage = LoginTest.reloadStorage(OUTDIR, "output-451155.txt");
|
||||
LoginTest.checkStorageData(storage, [utfHost], [utfUser1, utfUser2]);
|
||||
|
||||
|
||||
/*
|
||||
* ---------------------- Bug 454708 ----------------------
|
||||
* Check that previous saved entries that are not valid UTF8
|
||||
* are read without blowing up.
|
||||
*/
|
||||
|
||||
/* ========== 16 ========== */
|
||||
testnum++;
|
||||
testdesc = "ensure bogus UTF8 strings don't cause failures."
|
||||
|
||||
var badHost = "https://FcK" + String.fromCharCode(0x8a) + ".jp";
|
||||
var bad8User = Cc["@mozilla.org/login-manager/loginInfo;1"].
|
||||
createInstance(Ci.nsILoginInfo);
|
||||
bad8User.init(badHost, badHost, null,
|
||||
"dummydude", "itsasecret", "put_user_here", "put_pw_here");
|
||||
|
||||
storage = LoginTest.initStorage(INDIR, "signons-454708.txt",
|
||||
OUTDIR, "output-454708.txt");
|
||||
LoginTest.checkStorageData(storage, [], [bad8User]);
|
||||
|
||||
// The output file should contain valid UTF8 now, but the resulting
|
||||
// JS string value remains the same.
|
||||
|
||||
testdesc = "[flush and reload for verification]"
|
||||
storage = LoginTest.reloadStorage(OUTDIR, "output-454708.txt");
|
||||
LoginTest.checkStorageData(storage, [], [bad8User]);
|
||||
|
||||
/* ========== end ========== */
|
||||
} catch (e) {
|
||||
throw ("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
|
||||
|
Loading…
Reference in New Issue
Block a user