when comp_num is zero, the case folded DN is always ""
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Jun 2009 02:58:48 +0000 (12:58 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 1 Jun 2009 02:58:48 +0000 (12:58 +1000)
This fixes a bug where we would look at an uninitialised
dn->linearized

source4/lib/ldb/common/ldb_dn.c

index 402d6295015d141de84211692b1131f7a0a6ff70..6f462ddd8268b59b4757a9474e4906415da8cc08 100644 (file)
@@ -846,14 +846,8 @@ const char *ldb_dn_get_casefold(struct ldb_dn *dn)
        }
 
        if (dn->comp_num == 0) {
-               if (dn->linearized && dn->linearized[0] == '\0') {
-                       /* hmm a NULL dn, should we faild casefolding ? */
-                       dn->casefold = talloc_strdup(dn, "");
-                       return dn->casefold;
-               }
-               /* A DN must be NULL, special, or have components */
-               dn->invalid = true;
-               return NULL;
+               dn->casefold = talloc_strdup(dn, "");
+               return dn->casefold;
        }
 
        /* calculate maximum possible length of DN */