From 23da57f9febfe9091d5aea2052748c56378e15ed Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 1 Jun 2004 20:56:52 +0000 Subject: [PATCH] Set edn to NULL is ldap_get_dn() fails to avoid potential use of an unset variable. --- ldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap.c b/ldap.c index 0055602e1..8246eafc8 100644 --- a/ldap.c +++ b/ldap.c @@ -598,7 +598,7 @@ sudo_ldap_add_match(ld,entry) /* collect the dn, only show the rdn */ dn=ldap_get_dn(ld,entry); - if (dn) edn=ldap_explode_dn(dn,1); + edn=dn ? ldap_explode_dn(dn,1) : NULL; SAVE_LIST("\nLDAP Role: "); SAVE_LIST((edn && *edn) ? *edn : "UNKNOWN"); SAVE_LIST("\n"); -- 2.40.0