https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276960
Bug ID: 276960
Summary: /usr/include/*_asn1.h have unexpected target-dependent
differences
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: misc
Assignee: [email protected]
Reporter: [email protected]
Compare /usr/include/*_asn1.h on e.g. i386 and amd64.
One example file:
ref13-amd64% grep pCPath /usr/include/rfc2459_asn1.h
pCPathLenConstraint INTEGER (0..-1) OPTIONAL,
ref13-i386% grep pCPath /usr/include/rfc2459_asn1.h
pCPathLenConstraint INTEGER (0..2147483647) OPTIONAL,
Looking at the source file crypto/heimdal/lib/asn1/rfc2459.asn1:
pCPathLenConstraint INTEGER (0..4294967295) OPTIONAL, -- really MAX
4294967295 is 2^32-1, 0xffffffff, and does not fit in a signed 32-bit int.
I believe this originates from contrib/flex/src/regex.c:
n = (int) strtol (s, endptr, base);
i386 has 32-bit long. There strtol truncates 4294967295 to INT_MAX (2147483647)
and sets errno to ERANGE, which is then ignored.
amd64 has 64-bit long, into which 4294967295 fits. This becomes -1 when cast to
int.
--
You are receiving this mail because:
You are the assignee for the bug.