aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-08-28 16:49:55 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-08-28 16:49:55 +0200
commita21d0595b4604c2861401a24712fc802f9c6a003 (patch)
tree4de72541237446e1fb3f8e79f3eaf90ab1c523e5
parent46f4f794839998430e405d13d0f1b449f48a13c4 (diff)
downloadgcc-a21d0595b4604c2861401a24712fc802f9c6a003.zip
gcc-a21d0595b4604c2861401a24712fc802f9c6a003.tar.gz
gcc-a21d0595b4604c2861401a24712fc802f9c6a003.tar.bz2
re PR fortran/54382 (gfortran show_locus: Invalid read of size 4)
2012-08-28 Tobias Burnus <burnus@net-b.de> PR fortran/54382 * error.c (show_locus): Avoid out of bound access. From-SVN: r190752
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/error.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index f9bbf8a..3a6a23e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,10 @@
2012-08-28 Tobias Burnus <burnus@net-b.de>
+ PR fortran/54382
+ * error.c (show_locus): Avoid out of bound access.
+
+2012-08-28 Tobias Burnus <burnus@net-b.de>
+
PR fortran/54384
* decl.c (match_data_constant): Add missing gfc_free_expr.
(top_val_list): Remove always-true condition.
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index dde6a0f..64b9357 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -384,6 +384,7 @@ show_locus (locus *loc, int c1, int c2)
c1 -= offset;
c2 -= offset;
+ cmax -= offset;
p = &(lb->line[offset]);
for (i = 0; i <= cmax; i++)