This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Ping Re: Fix strtod integer/buffer overflow (bug 14459)
On Mon, Aug 27, 2012 at 4:51 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> Carlos, is this 2.15 backport OK? Tested x86_64 and x86.
>
> diff --git a/ChangeLog b/ChangeLog
> index f665050..b4b6254 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,20 @@
> +2012-08-27 Joseph Myers <joseph@codesourcery.com>
> +
> + [BZ #14459]
> + * stdlib/strtod_l.c: Include <stdint.h>.
> + (NDEBUG): Do not define.
> + (round_and_return): Change EXPONENT parameter to type intmax_t.
> + Rearrange calculations to avoid internal overflow possibilities.
> + (str_to_mpn): Change EXPONENT parameter to type intmax_t *.
> + Rearrange calculations to avoid internal overflow possibilities.
> + Assert that number fits inside MPNSIZE limbs.
> + (____STRTOF_INTERNAL): Change EXPONENT variable to type intmax_t.
> + Change DIG_NO, INT_NO and LEAD_ZERO to type size_t. Rearrange
> + calculations and add assertions to avoid internal overflow
> + possibilities. Add casts to avoid signed/unsigned operations.
> + * stdlib/tst-strtod-overflow.c: New file.
> + * stdlib/Makefile (tests): Add tst-strtod-overflow.
OK for 2.15. Thanks!
Cheers,
Carlos.