summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-10 16:05:16 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-11 10:03:40 +0100
commitfeb00fe7cc238a78b3832c116cb4634936597735 (patch)
treefc4a62bfa07e55d15a7e18f9de960e31b47ed9a4 /source4/dsdb/common
parent4fe63d927e5e684d3e2bec9642a1e77b056ab2ed (diff)
downloadsamba-feb00fe7cc238a78b3832c116cb4634936597735.tar.gz
samba-feb00fe7cc238a78b3832c116cb4634936597735.tar.bz2
samba-feb00fe7cc238a78b3832c116cb4634936597735.zip
s4:dsdb - proof against empty RDN values where expected
This should prevent crashes as pointed out on the mailing list.
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 04d97043b2..7f6ce64180 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1595,7 +1595,12 @@ int samdb_find_site_for_computer(struct ldb_context *ldb,
talloc_free(dn);
return LDB_ERR_INVALID_DN_SYNTAX;
}
+
rdn_val = ldb_dn_get_rdn_val(dn);
+ if (rdn_val == NULL) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
(*site_name) = talloc_strndup(mem_ctx, (const char *)rdn_val->data, rdn_val->length);
talloc_free(dn);
if (!*site_name) {