This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Don't reference past the end of the vector


*** TEST RESULTS FOR COMMIT 9c3630e983df43e68006b526a92c2a9a2b64dfd9 ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: 9c3630e983df43e68006b526a92c2a9a2b64dfd9

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]