|
From: <sv...@va...> - 2014-06-24 22:13:52
|
Author: philippe
Date: Tue Jun 24 22:13:43 2014
New Revision: 14097
Log:
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
Modified:
trunk/coregrind/m_execontext.c
Modified: trunk/coregrind/m_execontext.c
==============================================================================
--- trunk/coregrind/m_execontext.c (original)
+++ trunk/coregrind/m_execontext.c Tue Jun 24 22:13:43 2014
@@ -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;
|