summaryrefslogtreecommitdiff
path: root/source4/torture/ldap
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-09-04 14:06:40 +1200
committerAndrew Bartlett <abartlet@samba.org>2014-09-27 01:35:36 +0200
commita744dba3b9c140117613ddec8affd781ab82da87 (patch)
tree3a4361b799f840723b795c07d843d05e18482787 /source4/torture/ldap
parentedda534454b1c5a6d30f1b99baf502d3990f99dd (diff)
downloadsamba-a744dba3b9c140117613ddec8affd781ab82da87.tar.gz
torture: Fix use-after-free in ldap.nested-search
Found by AddressSanitizer Change-Id: Ie3bb4054201382cacb4b296308d561a3548f8cff Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture/ldap')
-rw-r--r--source4/torture/ldap/nested_search.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/torture/ldap/nested_search.c b/source4/torture/ldap/nested_search.c
index 47299c2c213..9699919ecc1 100644
--- a/source4/torture/ldap/nested_search.c
+++ b/source4/torture/ldap/nested_search.c
@@ -60,11 +60,13 @@ static int nested_search_callback(struct ldb_request *req,
"defaultNamingContext",
NULL
};
+ enum ldb_reply_type type;
sctx = talloc_get_type(req->context, struct nested_search_context);
+ type = ares->type;
/* sanity check */
- switch (ares->type) {
+ switch (type) {
case LDB_REPLY_ENTRY:
torture_comment(sctx->tctx, "nested_search_callback: LDB_REPLY_ENTRY\n");
ldb_msg = ares->message;
@@ -89,7 +91,7 @@ static int nested_search_callback(struct ldb_request *req,
}
/* not a search reply, then get out */
- if (ares->type != LDB_REPLY_ENTRY) {
+ if (type != LDB_REPLY_ENTRY) {
return res;
}