ldb_dn: remove unreachable code in dn_explode
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 7 Feb 2019 00:39:09 +0000 (13:39 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 13 Feb 2019 03:15:14 +0000 (04:15 +0100)
Every time I look at this file, I spend a few minutes wondering how
these bits of code are ever run. Never again.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/common/ldb_dn.c

index 3bd655adbd5154754ab5c1e5cbaa214acb53df7c..f053e815ad49d44f337a916f2095cd5d586e3113 100644 (file)
@@ -359,9 +359,6 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
                                        ex_name = d;
                                        in_ex_name = true;
                                        continue;
-                               } else if (p[0] == '\0') {
-                                       p++;
-                                       continue;
                                } else {
                                        in_extended = false;
                                        in_attr = true;
@@ -474,12 +471,6 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
                                continue;
                        }
 
-                       if (trim && (*p != '=')) {
-                               /* spaces/tabs are not allowed */
-                               ldb_dn_mark_invalid(dn);
-                               goto failed;
-                       }
-
                        if (*p == '=') {
                                /* attribute terminated */
                                in_attr = false;