[PATCH] mountmgr: Avoid operating on a null CFStringRef, which would crash.

Ken Thomases ken at codeweavers.com
Wed Sep 9 14:21:49 CDT 2020


Signed-off-by: Ken Thomases <ken at codeweavers.com>
---
 dlls/mountmgr.sys/diskarb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/mountmgr.sys/diskarb.c b/dlls/mountmgr.sys/diskarb.c
index 3d531b95ee5..12da89d7688 100644
--- a/dlls/mountmgr.sys/diskarb.c
+++ b/dlls/mountmgr.sys/diskarb.c
@@ -298,7 +298,7 @@ static CFStringRef find_service_id( const WCHAR *adapter )
 
         service = CFArrayGetValueAtIndex( services, i );
         name = SCNetworkInterfaceGetBSDName( SCNetworkServiceGetInterface(service) );
-        if (CFStringGetLength( name ) < ARRAY_SIZE( buf ))
+        if (name && CFStringGetLength( name ) < ARRAY_SIZE( buf ))
         {
             CFStringGetCharacters( name, CFRangeMake(0, CFStringGetLength(name)), buf );
             if (!lstrcmpW( buf, unix_name ) && (id = SCNetworkServiceGetServiceID( service )))
-- 
2.27.0




More information about the wine-devel mailing list