summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-09-25 01:09:55 +0200
committerStefan Metzmacher <metze@samba.org>2012-09-25 01:14:15 +0200
commitbbac4fb42fc441a2b744ad5c5ecf93fbce920665 (patch)
treed6d6f8de738f009fa873eeeb16c5350116b6deee
parentf44ad3671876802a42846597be901257633e8ca3 (diff)
downloadsamba-bbac4fb42fc441a2b744ad5c5ecf93fbce920665.tar.gz
samba-bbac4fb42fc441a2b744ad5c5ecf93fbce920665.tar.bz2
samba-bbac4fb42fc441a2b744ad5c5ecf93fbce920665.zip
s4:rpc_server/drsuapi: fix a crash in dcesrv_drsuapi_DsGetDomainControllerInfo_1()
metze
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index 1d51ce879a..3512de60f5 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -576,14 +576,9 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_sta
unsigned int i;
*r->out.level_out = r->in.req->req1.level;
- r->out.ctr = talloc(mem_ctx, union drsuapi_DsGetDCInfoCtr);
+ r->out.ctr = talloc_zero(mem_ctx, union drsuapi_DsGetDCInfoCtr);
W_ERROR_HAVE_NO_MEMORY(r->out.ctr);
- sites_dn = samdb_sites_dn(b_state->sam_ctx, mem_ctx);
- if (!sites_dn) {
- return WERR_DS_OBJ_NOT_FOUND;
- }
-
switch (*r->out.level_out) {
case -1:
/* this level is not like the others */
@@ -598,6 +593,11 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_sta
return WERR_UNKNOWN_LEVEL;
}
+ sites_dn = samdb_sites_dn(b_state->sam_ctx, mem_ctx);
+ if (!sites_dn) {
+ return WERR_DS_OBJ_NOT_FOUND;
+ }
+
ret = ldb_search(b_state->sam_ctx, mem_ctx, &res, sites_dn, LDB_SCOPE_SUBTREE, attrs,
"objectClass=server");