[3/5] wbemprox: Fix corner cases in IEnumWbemClassObject::Skip.

Hans Leidekker hans at codeweavers.com
Wed Jul 25 06:12:42 CDT 2012


---
 dlls/wbemprox/class.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index 5bd9c1c..af7d8f5 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -167,7 +167,9 @@ static HRESULT WINAPI enum_class_object_Skip(
 
     if (lTimeout != WBEM_INFINITE) FIXME("timeout not supported\n");
 
-    if (ec->index + nCount >= view->count)
+    if (!view->count) return WBEM_S_FALSE;
+
+    if (nCount > view->count - ec->index)
     {
         ec->index = view->count - 1;
         return WBEM_S_FALSE;
-- 
1.7.10.4







More information about the wine-patches mailing list