2 execontexts in an hash table chain are not necessarily the same size.
So, ensure that when size differs, we do not start to compare them,
as this could otherwise cause a read buffer overrun
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14097 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_execontext.c b/coregrind/m_execontext.c
index cec2c85..8747bdb 100644
--- a/coregrind/m_execontext.c
+++ b/coregrind/m_execontext.c
@@ -379,12 +379,9 @@
while (True) {
if (list == NULL) break;
ec_searchcmps++;
- same = True;
- for (i = 0; i < n_ips; i++) {
- if (list->ips[i] != ips[i]) {
- same = False;
- break;
- }
+ same = list->n_ips == n_ips;
+ for (i = 0; i < n_ips && same ; i++) {
+ same = list->ips[i] == ips[i];
}
if (same) break;
prev2 = prev;