Rob Shearman : inetmib1: Fix off-by-one error in findNextOidInTable.

Alexandre Julliard julliard at winehq.org
Wed Dec 2 10:22:14 CST 2009


Module: wine
Branch: master
Commit: d0f93223b1ec6cb94bf57bfb97540fe908cabf71
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d0f93223b1ec6cb94bf57bfb97540fe908cabf71

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Wed Dec  2 14:55:10 2009 +0000

inetmib1: Fix off-by-one error in findNextOidInTable.

index is 1-based, so take that into account when calculating the
pointer to pass into the compare function.

---

 dlls/inetmib1/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c
index b0ff812..1e56710 100644
--- a/dlls/inetmib1/main.c
+++ b/dlls/inetmib1/main.c
@@ -393,7 +393,7 @@ static UINT findNextOidInTable(AsnObjectIdentifier *oid,
              * an infinite loop.
              */
             for (++index; index <= table->numEntries && compare(key,
-                &table->entries[tableEntrySize * index]) == 0; ++index)
+                &table->entries[tableEntrySize * (index - 1)]) == 0; ++index)
                 ;
         }
         HeapFree(GetProcessHeap(), 0, key);




More information about the wine-cvs mailing list