mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-08 15:56:07 +08:00
Don't reference past the end of the vector
An earlier change made find_source_lines read: end = &data[size]; However, since 'size' is the size of the vector, this seems fishy. More obviously ok is to compute the end of the data directly: end = data.data () + size; 2018-02-09 Tom Tromey <tom@tromey.com> * source.c (find_source_lines): Don't reference past the end of the vector.
This commit is contained in:
@ -1219,7 +1219,7 @@ find_source_lines (struct symtab *s, int desc)
|
||||
size = myread (desc, data.data (), size);
|
||||
if (size < 0)
|
||||
perror_with_name (symtab_to_filename_for_display (s));
|
||||
end = &data[size];
|
||||
end = data.data () + size;
|
||||
p = &data[0];
|
||||
line_charpos[0] = 0;
|
||||
nlines = 1;
|
||||
|
Reference in New Issue
Block a user