aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gcov.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 44700f5..3b6af9e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-17 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/85871
+ * gcov.c (output_intermediate_file): Fix out of bounds
+ access.
+
2018-09-17 Vineet Gupta <vgupta@synopsys.com>
* config/arc/arc.c: Object attributes for core4 not reflected
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 64ab85c..c09d506 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1097,7 +1097,8 @@ output_intermediate_file (FILE *gcov_file, source_info *src)
}
/* Follow with lines associated with the source file. */
- output_intermediate_line (gcov_file, &src->lines[line_num], line_num);
+ if (line_num < src->lines.size ())
+ output_intermediate_line (gcov_file, &src->lines[line_num], line_num);
}
}