1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

Ensure all members are initialized before loading selfie

Theoretically, if a selfie is loaded from corrupted
storage resulting in a thrown exception from the
constructor, this would cause an improperly initialized
HostnameBasedDB instance and overall potentially a
broken uBO.

Related feedback:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1543880#c7
This commit is contained in:
Raymond Hill 2019-07-12 09:05:42 -04:00
parent ba6eb45e9c
commit d6927cf1fe
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -516,14 +516,14 @@
this.nBits = nBits;
this.timer = undefined;
this.strToIdMap = new Map();
if ( selfie !== undefined ) {
this.fromSelfie(selfie);
return;
}
this.hostnameToSlotIdMap = new Map();
this.hostnameSlots = [];
this.strSlots = [];
this.size = 0;
if ( selfie !== undefined ) {
this.fromSelfie(selfie);
return;
}
}
store(hn, bits, s) {