]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/62188 (Array bounds overrun in bessel_yn_r4/8/16 and other functions)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Wed, 20 Aug 2014 16:23:55 +0000 (16:23 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Wed, 20 Aug 2014 16:23:55 +0000 (16:23 +0000)
2014-08-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR libgfortran/62188
* m4/bessel.m4: Avoid indexing off the end of an array.
* generated/bessel_r10.c: Regenerated.
* generated/bessel_r16.c: Ditto.
* generated/bessel_r4.c: Ditto.
* generated/bessel_r8.c: Ditto.

From-SVN: r214231

libgfortran/ChangeLog
libgfortran/generated/bessel_r10.c
libgfortran/generated/bessel_r16.c
libgfortran/generated/bessel_r4.c
libgfortran/generated/bessel_r8.c
libgfortran/m4/bessel.m4

index a0868cd72cd9e6a85b95461d07a02d8fd963ab70..06d9da20d48329c09d21c175be72f123d6e4c1a0 100644 (file)
@@ -1,3 +1,12 @@
+2014-08-20  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR libgfortran/62188
+       * m4/bessel.m4: Avoid indexing off the end of an array.
+       * generated/bessel_r10.c: Regenerated.
+       * generated/bessel_r16.c: Ditto.
+       * generated/bessel_r4.c: Ditto.
+       * generated/bessel_r8.c: Ditto.
+
 2014-07-31  Janne Blomqvist  <jb@gcc.gnu.org>
 
        Backport from mainline
index 44da8478a8c1e6b40fbc4a431cb96a73a5a94593..e926d5c9e6956c076de62347e014e2a5cae0c150 100644 (file)
@@ -162,7 +162,7 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
 
   x2rev = GFC_REAL_10_LITERAL(2.)/x;
 
-  for (i = 2; i <= n1+n2; i++)
+  for (i = 2; i <= n2 - n1; i++)
     {
 #if defined(GFC_REAL_10_INFINITY)
       if (unlikely (last2 == -GFC_REAL_10_INFINITY))
index d0ad50a9ff080811e14b69ed565a6b0e0144977e..c0ee468ca96fa00cbd906ea11fbf752886aaae8b 100644 (file)
@@ -166,7 +166,7 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
 
   x2rev = GFC_REAL_16_LITERAL(2.)/x;
 
-  for (i = 2; i <= n1+n2; i++)
+  for (i = 2; i <= n2 - n1; i++)
     {
 #if defined(GFC_REAL_16_INFINITY)
       if (unlikely (last2 == -GFC_REAL_16_INFINITY))
index 5fe486bb77ea43fc17449b622e4ac3e5f0df9293..eedfc1fc0c528ba23396b93b91d810cd73d726b7 100644 (file)
@@ -162,7 +162,7 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
 
   x2rev = GFC_REAL_4_LITERAL(2.)/x;
 
-  for (i = 2; i <= n1+n2; i++)
+  for (i = 2; i <= n2 - n1; i++)
     {
 #if defined(GFC_REAL_4_INFINITY)
       if (unlikely (last2 == -GFC_REAL_4_INFINITY))
index 2150042cef387e4ae65d46f2bf4ec17eac7636ef..8e71cb9bc13e4434b21ea3a50fba250b652f5ec2 100644 (file)
@@ -162,7 +162,7 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
 
   x2rev = GFC_REAL_8_LITERAL(2.)/x;
 
-  for (i = 2; i <= n1+n2; i++)
+  for (i = 2; i <= n2 - n1; i++)
     {
 #if defined(GFC_REAL_8_INFINITY)
       if (unlikely (last2 == -GFC_REAL_8_INFINITY))
index bfdbf9a81e7d6586887191b3eb2a1318e86486c1..41adade7321e8012a313e0a7bcc914fb7280c174 100644 (file)
@@ -163,7 +163,7 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2,
 
   x2rev = GFC_REAL_'rtype_kind`_LITERAL(2.)/x;
 
-  for (i = 2; i <= n1+n2; i++)
+  for (i = 2; i <= n2 - n1; i++)
     {
 #if defined('rtype_name`_INFINITY)
       if (unlikely (last2 == -'rtype_name`_INFINITY))