Message ID | 4870fc93-44b7-bfce-d3f1-5f8db6286ff2@suse.cz |
---|---|
State | New |
Headers | show |
Series | Fix out-of-bounds in gcov.c (PR gcov-profile/85871). | expand |
diff --git a/gcc/gcov.c b/gcc/gcov.c index 6a24a320046..c6cf79b0f53 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -1085,7 +1085,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); } }