From e2181617a00d7982e4e6ced1c51aa2ee8a40df26 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Dec 2012 18:39:29 +0100 Subject: s4:dsdb/acl_read: check the ldb_attr_list_copy_add() result Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source4/dsdb/samdb/ldb_modules/acl_read.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c b/source4/dsdb/samdb/ldb_modules/acl_read.c index 2b20f249d9..c42db5f13b 100644 --- a/source4/dsdb/samdb/ldb_modules/acl_read.c +++ b/source4/dsdb/samdb/ldb_modules/acl_read.c @@ -375,12 +375,18 @@ static int aclread_search(struct ldb_module *module, struct ldb_request *req) if (!ldb_attr_in_list(req->op.search.attrs, "instanceType")) { ac->instance_type = true; attrs = ldb_attr_list_copy_add(ac, req->op.search.attrs, "instanceType"); + if (attrs == NULL) { + return ldb_oom(ldb); + } } else { attrs = req->op.search.attrs; } if (!ldb_attr_in_list(req->op.search.attrs, "objectSid")) { ac->object_sid = true; attrs = ldb_attr_list_copy_add(ac, attrs, "objectSid"); + if (attrs == NULL) { + return ldb_oom(ldb); + } } } @@ -389,8 +395,14 @@ static int aclread_search(struct ldb_module *module, struct ldb_request *req) * if attribute list is empty */ if (!attrs) { attrs = ldb_attr_list_copy_add(ac, req->op.search.attrs, "*"); + if (attrs == NULL) { + return ldb_oom(ldb); + } } attrs = ldb_attr_list_copy_add(ac, attrs, "nTSecurityDescriptor"); + if (attrs == NULL) { + return ldb_oom(ldb); + } } ac->attrs = req->op.search.attrs; ret = ldb_build_search_req_ex(&down_req, -- cgit