CVE-2019-3824 ldb: ldb_parse_tree use talloc_zero
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 18 Feb 2019 21:25:24 +0000 (10:25 +1300)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Feb 2019 06:50:15 +0000 (07:50 +0100)
Initialise the created ldb_parse_tree with talloc_zero, this ensures
that it is correctly initialised if inadvertently passed to a function
expecting a different operation type.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13773

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
lib/ldb/common/ldb_parse.c

index 5fa5a74afa9d5721d207ab63ebc200347dd27b04..db4200913119c2557e98ea1d11ba56a028b3ce29 100644 (file)
@@ -389,7 +389,7 @@ static struct ldb_parse_tree *ldb_parse_simple(TALLOC_CTX *mem_ctx, const char *
        struct ldb_parse_tree *ret;
        enum ldb_parse_op filtertype;
 
-       ret = talloc(mem_ctx, struct ldb_parse_tree);
+       ret = talloc_zero(mem_ctx, struct ldb_parse_tree);
        if (!ret) {
                errno = ENOMEM;
                return NULL;