From afdd5fbd51b4dbde419da7bc64bab5eaf42a955d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 Dec 2013 15:44:37 +1300 Subject: [PATCH] dsdb: check type with talloc_get_type_abort in samdb_set_password Change-Id: Ie5b534c70dd87ecf58d6a830e38750ecf16eb855 Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher --- source4/dsdb/common/util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 1bb2fce7e58..9dbdbdd7b29 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2153,8 +2153,11 @@ NTSTATUS samdb_set_password(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, ret = dsdb_autotransaction_request(ldb, req); if (req->context != NULL) { - pwd_stat = talloc_steal(mem_ctx, - ((struct ldb_control *)req->context)->data); + struct ldb_control *control = talloc_get_type_abort(req->context, + struct ldb_control); + pwd_stat = talloc_get_type_abort(control->data, + struct dsdb_control_password_change_status); + talloc_steal(mem_ctx, pwd_stat); } talloc_free(req); -- 2.34.1