[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Sep 4 18:21:03 UTC 2019


The branch, master has been updated
       via  1e2d2094947 torture: Fix the FreeBSD clang build
       via  e8ac8a357ae samr: Fix CID 1453463: Null pointer dereferences (NULL_RETURNS)
       via  3a0047eaf18 dsdb: Fix CID 1453464: Error handling issues (CHECKED_RETURN)
       via  09946c558fa dsdb: Fix CID 1453465: Null pointer dereferences (NULL_RETURNS)
      from  ad4ef1657e9 s3:ldap: Fix join with don't exists machine account

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


- Log -----------------------------------------------------------------
commit 1e2d209494769cb23f10d3c8f8f294acdc9147f6
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 4 11:32:58 2019 +0200

    torture: Fix the FreeBSD clang build
    
    clang complained that "full_filename==NULL" is always false, because
    it's a normal stack variable.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Sep  4 18:20:22 UTC 2019 on sn-devel-184

commit e8ac8a357aec218807f1b750c004bc2f88aa4b08
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Sep 3 10:38:35 2019 +0200

    samr: Fix CID 1453463: Null pointer dereferences (NULL_RETURNS)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3a0047eaf18a1dffdedfd6625aeac9f6d7255045
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Sep 3 10:35:33 2019 +0200

    dsdb: Fix CID 1453464: Error handling issues (CHECKED_RETURN)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 09946c558fade9ea64f0ef2357bf865c6e1ec441
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Sep 3 10:29:53 2019 +0200

    dsdb: Fix CID 1453465: Null pointer dereferences (NULL_RETURNS)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 source4/dsdb/samdb/ldb_modules/encrypted_secrets.c | 8 ++++++++
 source4/dsdb/schema/schema_set.c                   | 8 +++++++-
 source4/rpc_server/samr/dcesrv_samr.c              | 5 +++++
 source4/torture/libsmbclient/libsmbclient.c        | 4 ++--
 4 files changed, 22 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c b/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c
index 0d46031ec64..7e6d4b160d4 100644
--- a/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c
+++ b/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c
@@ -834,6 +834,14 @@ static const struct ldb_message *encrypt_secret_attributes(
 			struct ldb_message_element* enc = NULL;
 			if (encrypted_msg == NULL) {
 				encrypted_msg = ldb_msg_copy_shallow(ctx, msg);
+				if (encrypted_msg == NULL) {
+					ldb_set_errstring(
+						ldb,
+						"Out of memory, allocating "
+						"ldb_message_element\n");
+					*err = LDB_ERR_OPERATIONS_ERROR;
+					return NULL;
+				}
 				encrypted_msg->dn = msg->dn;
 			}
 			enc = encrypt_element(err,
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 943d0ef49f5..2ee2596570e 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -904,6 +904,7 @@ int dsdb_schema_fill_extended_dn(struct ldb_context *ldb, struct dsdb_schema *sc
 		const struct ldb_val *rdn;
 		struct ldb_val guid;
 		NTSTATUS status;
+		int ret;
 		struct ldb_dn *dn = ldb_dn_new(NULL, ldb, cur->defaultObjectCategory);
 
 		if (!dn) {
@@ -925,7 +926,12 @@ int dsdb_schema_fill_extended_dn(struct ldb_context *ldb, struct dsdb_schema *sc
 			talloc_free(dn);
 			return ldb_operr(ldb);
 		}
-		ldb_dn_set_extended_component(dn, "GUID", &guid);
+		ret = ldb_dn_set_extended_component(dn, "GUID", &guid);
+		if (ret != LDB_SUCCESS) {
+			ret = ldb_error(ldb, ret, "Could not set GUID");
+			talloc_free(dn);
+			return ret;
+		}
 
 		cur->defaultObjectCategory = ldb_dn_get_extended_linearized(cur, dn, 1);
 		talloc_free(dn);
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 29e1bd4608f..70f914bf14c 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -1649,6 +1649,11 @@ static int user_iterate_callback(struct ldb_request *req,
 
 		ent = &(ac->entries[ac->num_entries++]);
 		val = ldb_msg_find_ldb_val(msg, "samaccountname");
+		if (val == NULL) {
+			DBG_WARNING("samaccountname attribute not found\n");
+			ret = ldb_request_done(req, LDB_ERR_OPERATIONS_ERROR);
+			break;
+		}
 		ent->name.string = talloc_steal(ac->entries,
 					        (char *)val->data);
 		ent->idx = rid;
diff --git a/source4/torture/libsmbclient/libsmbclient.c b/source4/torture/libsmbclient/libsmbclient.c
index 7bc407ac905..b74d87aabed 100644
--- a/source4/torture/libsmbclient/libsmbclient.c
+++ b/source4/torture/libsmbclient/libsmbclient.c
@@ -421,7 +421,7 @@ static bool torture_libsmbclient_readdirplus_seek(struct torture_context *tctx)
 		filename[i] = talloc_asprintf(tctx,
 				"test_readdirplus_%u.txt",
 				i);
-		if (full_filename == NULL) {
+		if (filename[i] == NULL) {
 			torture_fail_goto(tctx,
 				done,
 				"talloc fail\n");
@@ -430,7 +430,7 @@ static bool torture_libsmbclient_readdirplus_seek(struct torture_context *tctx)
 				"%s/%s",
 				dname,
 				filename[i]);
-		if (full_filename == NULL) {
+		if (full_filename[i] == NULL) {
 			torture_fail_goto(tctx,
 				done,
 				"talloc fail\n");


-- 
Samba Shared Repository



More information about the samba-cvs mailing list