idmap_ldap: Fix CID 1404836 Dereference before null check
authorVolker Lendecke <vl@samba.org>
Thu, 6 Apr 2017 09:35:23 +0000 (11:35 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Thu, 6 Apr 2017 17:31:24 +0000 (19:31 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Apr  6 19:31:25 CEST 2017 on sn-devel-144

source3/winbindd/idmap_ldap.c

index 041152cc1fbc550ac998b2a66c8ddfaff58eee9a..754506180820b5cebac54119e8eeb46d42febfe2 100644 (file)
@@ -78,16 +78,7 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx,
        tmp = idmap_config_const_string(dom->name, "ldap_user_dn", NULL);
 
        if ( tmp ) {
-               if (!dom) {
-                       DEBUG(0, ("get_credentials: Invalid domain 'NULL' "
-                                 "encountered for user DN %s\n",
-                                 tmp));
-                       ret = NT_STATUS_UNSUCCESSFUL;
-                       goto done;
-               } else {
-                       secret = idmap_fetch_secret("ldap", dom->name, tmp);
-               }
-
+               secret = idmap_fetch_secret("ldap", dom->name, tmp);
                if (!secret) {
                        DEBUG(0, ("get_credentials: Unable to fetch "
                                  "auth credentials for %s in %s\n",