diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-11-11 19:24:48 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-12 16:34:14 +1100 |
commit | 5940ca60e23d142e4d3d0b2ce12f191663147d03 (patch) | |
tree | 401d9b942265d4f5dcce418e64d2796cc1e98250 /source4/lib/ldb/common | |
parent | 716bba545729dbb46631bf233c1023576de54926 (diff) | |
download | samba-5940ca60e23d142e4d3d0b2ce12f191663147d03.tar.gz samba-5940ca60e23d142e4d3d0b2ce12f191663147d03.tar.bz2 samba-5940ca60e23d142e4d3d0b2ce12f191663147d03.zip |
s4:ldb Don't segfault if we somehow get an unknown extended dn element
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_dn.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index 036f4a223e..9ac654973a 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -781,6 +781,9 @@ char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode) int ret; ext_syntax = ldb_dn_extended_syntax_by_name(dn->ldb, name); + if (!ext_syntax) { + return NULL; + } if (mode == 1) { ret = ext_syntax->write_clear_fn(dn->ldb, mem_ctx, @@ -1823,6 +1826,11 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn, return LDB_ERR_OTHER; } + if (!ldb_dn_extended_syntax_by_name(dn->ldb, name)) { + /* We don't know how to handle this type of thing */ + return LDB_ERR_INVALID_DN_SYNTAX; + } + for (i=0; i < dn->ext_comp_num; i++) { if (ldb_attr_cmp(dn->ext_components[i].name, name) == 0) { if (val) { |