From 2c5da008f7a8a1772e6c41a371c41c8fd2eb2950 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 25 Jul 2012 13:12:42 +0200 Subject: [PATCH] wbemprox: Fix corner cases in IEnumWbemClassObject::Skip. --- 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 5bd9c1c076d..af7d8f5fc60 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;