Fix buffer overrun in 'equals' function for arrays

I noticed a buffer overrun in the equals overload for arrays.  This
patch fixes that.

	* src/abg-ir.cc (equals): In the overload for arrays, check for
	the end of the subranges of the two arrays, not just for the first
	one.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2017-03-31 12:00:20 +02:00
parent c022243aac
commit 9fa58eca69

View File

@ -11414,7 +11414,7 @@ equals(const array_type_def& l, const array_type_def& r, change_kind* k)
std::vector<array_type_def::subrange_sptr >::const_iterator i,j;
for (i = this_subs.begin(), j = other_subs.begin();
i != this_subs.end();
i != this_subs.end() && j != other_subs.end();
++i, ++j)
if (**i != **j)
{