s4/dn: handle case 'base' dn has no components
authorKamen Mazdrashki <kamenim@samba.org>
Sat, 8 May 2010 07:19:14 +0000 (10:19 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Mon, 10 May 2010 20:45:20 +0000 (23:45 +0300)
This could if the 'base' dn is special for example.

source4/lib/ldb/common/ldb_dn.c

index d91e9d9fa9bbbcb1da602d84a854776a8cfa78d3..00646f6ba54418dcac2d57bee3e671a9980eaa5f 100644 (file)
@@ -1065,7 +1065,7 @@ int ldb_dn_compare_base(struct ldb_dn *base, struct ldb_dn *dn)
                return (dn->comp_num - base->comp_num);
        }
 
-       if (dn->comp_num == 0) {
+       if ((dn->comp_num == 0) || (base->comp_num == 0)) {
                if (dn->special && base->special) {
                        return strcmp(base->linearized, dn->linearized);
                } else if (dn->special) {