[PATCH] Fix a Coverity finding

vl at samba.org vl at samba.org
Thu Apr 6 09:40:35 UTC 2017


Hi!

Review appreciated!

Thanks, Volker
-------------- next part --------------
From 1a994b1d7546b8c88065894616e74d9f99e5ae34 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 6 Apr 2017 11:35:23 +0200
Subject: [PATCH] idmap_ldap: Fix CID 1404836 Dereference before null check

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/winbindd/idmap_ldap.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 041152c..7545061 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -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",
-- 
2.1.4



More information about the samba-technical mailing list