]> granicus.if.org Git - sudo/commitdiff
Set edn to NULL is ldap_get_dn() fails to avoid potential use of an unset
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 1 Jun 2004 20:56:52 +0000 (20:56 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 1 Jun 2004 20:56:52 +0000 (20:56 +0000)
variable.

ldap.c

diff --git a/ldap.c b/ldap.c
index 0055602e1aea3a8366d13c1eef8b48a497cd8a36..8246eafc8098a53d9a635ecb0cc207a8819e57b1 100644 (file)
--- 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");