[PATCH 1/2] Parse hex and octal strings correctly in __strtoul_internal
Siddhesh Poyarekar
siddhesh@redhat.com
Thu Apr 19 06:23:00 GMT 2012
Hi,
The current implementation of __strtoul_internal seems to only pretend
to support hex and octal strings by detecting a preceding 0x or 0 and
marking base as 8 or 16. When it comes to the actual processing of the
string, it only considers numeric values within, thus breaking hex
values that may have [a-f] in them. It looks like hexadecimal numbers
were never parsed in the linker anywhere and hence it got away with
this.
Attached patch adds validation for hexadecimal and octal values since
the next patch [2/2] looks to use this to parse hexadecimal numbers.
The test suite reports no regressions and the only place where the hex
logic is tested, i.e. [patch 2/2] works corectly with this fix.
Regards,
Siddhesh
ChangeLog:
2012-04-19 Siddhesh Poyarekar <siddhesh@redhat.com>
* elf/dl-minimal.c (__strtoul_internal): Parse hexadecimal and
octal strings correctly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Parse-hexadecimal-and-octal-strings-correctly.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120419/cdb625cc/attachment.bin>
More information about the Libc-alpha
mailing list