[Bug libc/10571] New: strtol() cutoff range cause premature overflow
shihjong dot kuo at intel dot com
sourceware-bugzilla@sourceware.org
Fri Aug 28 14:34:00 GMT 2009
I noticed premature overflow due cutoff range value set in strtol_l.c for long
string and using a number of base values. strtol() reported overflowed value
while the string should have been valid. The cutoff values I saw were
0x55555555_55555555 for base=3, 0x3fffffff_ffffffff for base=4,
0x33333333_33333333 for base=5, 0x2aaaaaaa_aaaaaaaa for base=6 with glibc 2.9.
2.10 looks to use the same macro definition for the cutoff table definition.
It seems to me the cutoff value need not be a table with different ranges that
vary with base value, why not just a simple constant 0x7fffffff_ffffffff for
all base values?
--
Summary: strtol() cutoff range cause premature overflow
Product: glibc
Version: 2.9
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: shihjong dot kuo at intel dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=10571
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the Glibc-bugs
mailing list