[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Dec 6 11:14:03 UTC 2019


The branch, master has been updated
       via  e79e943824a ldb:tests: Add missing null check for ldb_kv_private
       via  9323b5c5004 ldb:tests: Add missing size check for tdb
       via  e464e40c977 ldb:tests: Use assert_in_range() in test_get_size()
       via  9a1072ddb6b ldb: Avoid a possible NULL pointer dereference
      from  fe2901e1074 WHATSNEW: document SMB_VFS_NTIMES() interface change

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e79e943824ad0960916585d09d0dd6061f7518f9
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 5 17:17:42 2019 +0100

    ldb:tests: Add missing null check for ldb_kv_private
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Gary Lockyer <gary at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Dec  6 11:13:24 UTC 2019 on sn-devel-184

commit 9323b5c50042738b4afbea3dc0db0ddbc096f99c
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 5 17:15:01 2019 +0100

    ldb:tests: Add missing size check for tdb
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Gary Lockyer <gary at samba.org>

commit e464e40c977cd6592240763c7dbb9c45ff16470f
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 5 17:14:31 2019 +0100

    ldb:tests: Use assert_in_range() in test_get_size()
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Gary Lockyer <gary at samba.org>

commit 9a1072ddb6b5ddf7916496068cf9c155eb7762c8
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 5 17:02:39 2019 +0100

    ldb: Avoid a possible NULL pointer dereference
    
    Found by cppcheck.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Gary Lockyer <gary at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb/ldb_key_value/ldb_kv_index.c |  2 +-
 lib/ldb/tests/ldb_kv_ops_test.c      | 13 +++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/ldb_key_value/ldb_kv_index.c b/lib/ldb/ldb_key_value/ldb_kv_index.c
index 0853b28fe40..059abef6748 100644
--- a/lib/ldb/ldb_key_value/ldb_kv_index.c
+++ b/lib/ldb/ldb_key_value/ldb_kv_index.c
@@ -1175,7 +1175,7 @@ static struct ldb_dn *ldb_kv_index_key(struct ldb_context *ldb,
 		}
 	}
 
-	if (v.data != value->data && !empty_val) {
+	if (value != NULL && v.data != value->data && !empty_val) {
 		talloc_free(v.data);
 	}
 	talloc_free(attr_folded);
diff --git a/lib/ldb/tests/ldb_kv_ops_test.c b/lib/ldb/tests/ldb_kv_ops_test.c
index 98b5a433f1a..30adebf1952 100644
--- a/lib/ldb/tests/ldb_kv_ops_test.c
+++ b/lib/ldb/tests/ldb_kv_ops_test.c
@@ -818,7 +818,7 @@ static void do_iterate_range_test(void **state, int range_start,
 	int ret;
 	struct test_ctx *test_ctx = talloc_get_type_abort(*state,
 							  struct test_ctx);
-	struct ldb_kv_private *ldb_kv = get_ldb_kv(test_ctx->ldb);
+	struct ldb_kv_private *ldb_kv = NULL;
 	int i;
 	int num_recs = 1024;
 	int skip_recs = 10;
@@ -827,6 +827,9 @@ static void do_iterate_range_test(void **state, int range_start,
 
 	TALLOC_CTX *tmp_ctx;
 
+	ldb_kv = get_ldb_kv(test_ctx->ldb);
+	assert_non_null(ldb_kv);
+
 	for (i = 0; i < num_recs; i++){
 		visits[i] = 0;
 	}
@@ -1715,7 +1718,7 @@ static void test_get_size(void **state)
 	 * The tdb implementation of get_size over estimates for sparse files
 	 * which is perfectly acceptable for it's intended use.
 	 */
-	assert_true( size > 2500);
+	assert_in_range(size, 2500, 5000);
 #endif
 
 	/*
@@ -1739,6 +1742,12 @@ static void test_get_size(void **state)
 	size = ldb_kv->kv_ops->get_size(ldb_kv);
 #ifdef TEST_LMDB
 	assert_int_equal(3, size);
+#else
+	/*
+	 * The tdb implementation of get_size over estimates for sparse files
+	 * which is perfectly acceptable for it's intended use.
+	 */
+	assert_in_range(size, 2500, 5000);
 #endif
 	talloc_free(tmp_ctx);
 }


-- 
Samba Shared Repository



More information about the samba-cvs mailing list