summaryrefslogtreecommitdiffstats
path: root/stdlib/strtod_l.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-09-01 12:38:44 -0700
committerPetr Baudis <pasky@suse.cz>2010-11-09 02:12:46 +0100
commit5f353d1e05659d8515511f28b875b9fd10c1a661 (patch)
tree548641655af2f4957b9b35ba96b369a433f2e682 /stdlib/strtod_l.c
parentActually make it possible to user the default name server. (diff)
downloadglibc-5f353d1e05659d8515511f28b875b9fd10c1a661.tar.xz
glibc-5f353d1e05659d8515511f28b875b9fd10c1a661.zip
Fix array overflow in floating point parser
(cherry picked from commit a726d7960e8a4ac784131f591114a0ef14246d8b)
Diffstat (limited to '')
-rw-r--r--stdlib/strtod_l.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 9ddfa3fa66..099fcf751e 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -1491,7 +1491,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
register int i;
(void) __mpn_lshift (&retval[used
/ BITS_PER_MP_LIMB],
- retval, RETURN_LIMB_SIZE,
+ retval,
+ (RETURN_LIMB_SIZE
+ - used / BITS_PER_MP_LIMB),
used % BITS_PER_MP_LIMB);
for (i = used / BITS_PER_MP_LIMB - 1; i >= 0; --i)
retval[i] = 0;