From c4c64ff51f7ee6a332f71f093ffd37e06745e785 Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Tue, 23 Jan 2018 11:02:28 +1300 Subject: [PATCH] ldb_mod_op_test: Fix core dump on ldb_case_attrs_index_test_teardown With no schema syntax, this would occasionally crash as it dereferenced some possibly NULL sequence of memory. Note: Removing all tests except this one, made it crash reliably. Signed-off-by: Gary Lockyer Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- lib/ldb/tests/ldb_mod_op_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ldb/tests/ldb_mod_op_test.c b/lib/ldb/tests/ldb_mod_op_test.c index 766ca7983354..5878143d8f62 100644 --- a/lib/ldb/tests/ldb_mod_op_test.c +++ b/lib/ldb/tests/ldb_mod_op_test.c @@ -2587,6 +2587,14 @@ static void test_ldb_attrs_index_handler(void **state) syntax, &cn_attr_2); assert_int_equal(ret, LDB_SUCCESS); + syntax = ldb_standard_syntax_by_name(ldb, LDB_SYNTAX_OCTET_STRING); + assert_non_null(syntax); + + ret = ldb_schema_attribute_fill_with_syntax(ldb, ldb, + "", 0, + syntax, &default_attr); + assert_int_equal(ret, LDB_SUCCESS); + /* * Set an attribute handler */ -- 2.34.1