summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2015-05-23 00:02:42 -0700
committerMatthieu Patou <mat@samba.org>2015-05-27 18:40:35 +0200
commitce4830e00a62b16adc344107e2d5dc5e85588be3 (patch)
tree5166d5dff9a547e0cc4d7d6c28d63ce549e8f5af /source4/dsdb
parent062bc17393f1cc65a0ae748202c739ba2375282f (diff)
downloadsamba-ce4830e00a62b16adc344107e2d5dc5e85588be3.tar.gz
Fix segfault in the very rare case when we are not able to find the rootnamingcontext
Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Volker Lendecke <vl@samba.org> Change-Id: I96fd5c7f39280090d5ec1dcdcb445fd7a44bd1c6 Autobuild-User(master): Matthieu Patou <mat@samba.org> Autobuild-Date(master): Wed May 27 18:40:35 CEST 2015 on sn-devel-104
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 7b948f2d81f..2b7d4926392 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3468,7 +3468,7 @@ int dsdb_find_nc_root(struct ldb_context *samdb, TALLOC_CTX *mem_ctx, struct ldb
ret = ldb_search(samdb, tmp_ctx, &root_res,
ldb_dn_new(tmp_ctx, samdb, ""), LDB_SCOPE_BASE, root_attrs, NULL);
- if (ret != LDB_SUCCESS) {
+ if (ret != LDB_SUCCESS || root_res->count == 0) {
DEBUG(1,("Searching for namingContexts in rootDSE failed: %s\n", ldb_errstring(samdb)));
talloc_free(tmp_ctx);
return ret;