-
Notifications
You must be signed in to change notification settings - Fork 33
XorBinaryFuse silent failure #49
Copy link
Copy link
Open
Description
There is code in XorBinaryFuse8
that appears to silently fail, and fill the fingerprint array with 0xFF.
Then, the code in mayContain goes like this:
byte f = fingerprint(hash)
f ^= fingerprints[h0] ^ fingerprints[h1] ^ fingerprints[h2];
return (f & 0xff) == 0;
that essentially becomes
f ^= 0xFF ^ 0xFF ^ 0xFF
return (f & 0xff) == 0;
or
f ^= 0xFF;
return (f & 0xFF) == 0;
or
return (f == 0xFF)
In other words, mayContain will now return false most inputs, generating false negatives.
I would suggest that this behaviour is catastrophic in practical code, and a better approach would be to modify the code to through an exception.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels