Hans Leidekker : wbemprox: Perform a case insensitive match on path components.

Alexandre Julliard julliard at winehq.org
Tue Sep 10 16:49:29 CDT 2019


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Sep 10 17:09:10 2019 +0200

wbemprox: Perform a case insensitive match on path components.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wbemprox/services.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c
index be35c95ec0..0af02a4a1d 100644
--- a/dlls/wbemprox/services.c
+++ b/dlls/wbemprox/services.c
@@ -338,8 +338,7 @@ static HRESULT parse_path( const WCHAR *str, struct path **ret )
 
     if (*p == '\\')
     {
-        static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2'};
-
+        static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
         WCHAR server[MAX_COMPUTERNAME_LENGTH+1];
         DWORD server_len = ARRAY_SIZE(server);
 
@@ -352,8 +351,7 @@ static HRESULT parse_path( const WCHAR *str, struct path **ret )
         if (!*p) return WBEM_E_INVALID_OBJECT_PATH;
 
         len = p - q;
-        if (!GetComputerNameW( server, &server_len ) || server_len != len
-                || memcmp( q, server, server_len * sizeof(WCHAR) ))
+        if (!GetComputerNameW( server, &server_len ) || server_len != len || wcsnicmp( q, server, server_len ))
             return WBEM_E_NOT_SUPPORTED;
 
         q = ++p;
@@ -361,7 +359,7 @@ static HRESULT parse_path( const WCHAR *str, struct path **ret )
         if (!*p) return WBEM_E_INVALID_OBJECT_PATH;
 
         len = p - q;
-        if (len != ARRAY_SIZE(cimv2W) || memcmp( q, cimv2W, sizeof(cimv2W) ))
+        if (len != ARRAY_SIZE(cimv2W) - 1 || wcsnicmp( q, cimv2W, ARRAY_SIZE(cimv2W) - 1 ))
             return WBEM_E_INVALID_NAMESPACE;
         p++;
     }




More information about the wine-cvs mailing list