https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8580
Bug ID: 8580
Summary: NetSet lookup without Net::Patricia does not strip
leading zeros from an IPv4 address
Product: Spamassassin
Version: 4.0.2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Libraries
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: Undefined
Created attachment 6303
--> https://bz.apache.org/SpamAssassin/attachment.cgi?id=6303&action=edit
patch to strip leading zeros before contains_ip calls NetAddr::IP
NetAddr::IP version 4.079 has an issue with addresses that contain leading
zeros, reading them as octal in new() but decimal in new6(). When Net::Patricia
is available, contains_ip in NetSet.pm strips leading zeros from an IPv4
address before looking it up with Net::Patricia. Without Net::Patricia
installed, contains_ip passes the IPv4 address directly to NetAddr::IP. Some
developer versions of not yet released NetAddr::IP 4.080 refuse an IPv4 address
that contains leading zeros. If that behavior will be in the 4.080 release, it
will break existing tests in t/cidrs.t on systems without Net::Patricia.
Currently the addresses that SpamAssassin itself looks up with contains_ip have
no leading zeros, so this bug only has visible effect in tests that fail.
The attached patch strips the leading zeros from a four-part IPv4 address
before contains_ip passes it to NetAddr::IP, as add_cidr already does.
--
You are receiving this mail because:
You are the assignee for the bug.