aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-09-01 12:38:44 -0700
committerAndreas Schwab <schwab@redhat.com>2010-12-01 15:35:11 +0100
commitf844fe667e5b2dd79735ac5730ee75cd574c9674 (patch)
tree528878faf986f3c3b1428aaf9b0d7054f3b227a9
parent36f5b87d0e54ffb3efa3ebec86a77bc89b1b98f7 (diff)
downloadglibc-f844fe667e5b2dd79735ac5730ee75cd574c9674.zip
glibc-f844fe667e5b2dd79735ac5730ee75cd574c9674.tar.gz
glibc-f844fe667e5b2dd79735ac5730ee75cd574c9674.tar.bz2
Fix array overflow in floating point parser
(cherry picked from commit a726d7960e8a4ac784131f591114a0ef14246d8b)
-rw-r--r--ChangeLog6
-rw-r--r--stdlib/strtod_l.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ad8a25f..846333a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-31 Andreas Schwab <schwab@redhat.com>
+
+ [BZ #7066]
+ * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix array overflow when
+ shifting retval into place.
+
2010-09-14 Ulrich Drepper <drepper@redhat.com>
* resolv/res_init.c (__res_vinit): Count the default server we added.
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index cde1280..537d1fb 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;