Ken Thomases : mountmgr: Avoid operating on a null CFStringRef, which would crash.

Alexandre Julliard julliard at winehq.org
Tue Mar 23 15:07:44 CDT 2021


Module: wine
Branch: oldstable
Commit: 432e3297d1bfca3ce208da38799999dd188d3da2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=432e3297d1bfca3ce208da38799999dd188d3da2

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed Sep  9 14:21:49 2020 -0500

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

Signed-off-by: Ken Thomases <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 7e312c346cc94f093d82324f9020ac5595464f61)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 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 8bbf43579c8..bd1fcae9206 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 )))




More information about the wine-cvs mailing list