mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01: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:
parent
ba6eb45e9c
commit
d6927cf1fe
@ -516,14 +516,14 @@
|
|||||||
this.nBits = nBits;
|
this.nBits = nBits;
|
||||||
this.timer = undefined;
|
this.timer = undefined;
|
||||||
this.strToIdMap = new Map();
|
this.strToIdMap = new Map();
|
||||||
if ( selfie !== undefined ) {
|
|
||||||
this.fromSelfie(selfie);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.hostnameToSlotIdMap = new Map();
|
this.hostnameToSlotIdMap = new Map();
|
||||||
this.hostnameSlots = [];
|
this.hostnameSlots = [];
|
||||||
this.strSlots = [];
|
this.strSlots = [];
|
||||||
this.size = 0;
|
this.size = 0;
|
||||||
|
if ( selfie !== undefined ) {
|
||||||
|
this.fromSelfie(selfie);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
store(hn, bits, s) {
|
store(hn, bits, s) {
|
||||||
|
Loading…
Reference in New Issue
Block a user