https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8516

            Bug ID: 8516
           Summary: FuzzyHash::ZOrder computes wrong fuzzy HashBL keys on
                    Perl 5.14 and 5.16
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Libraries
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: Undefined

Created attachment 6218
  --> https://bz.apache.org/SpamAssassin/attachment.cgi?id=6218&action=edit
Untaint the token hashes before the MinHash loop

t/hashbl.t fails its fuzzy checks (X_HASHBL_FUZZY_STRICT, META_HASHBL_FUZZY) on
Perl 5.14 and 5.16.

FuzzyHash::ZOrder::_minhash multiplies 32-bit integers, keeping the low 32 bits
of the product. Perl before version 5.18 in taint mode using tainted values
uses floating point calculations that lose the low bits, causing the fuzzy
checks to not match.

The attached patch ensures that the hash calculation uses untainted values.
That makes the results correct on Perl 5.14 and 5.16. In newer Perl versions,
the loop runs two to three times faster with untainted values without changing
the results.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to