[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Tue Oct 22 18:49:02 UTC 2019


The branch, master has been updated
       via  6ebd0ba735e s3/libsmb: clang: Fix 'the left operand of '-' is a garbage value'
       via  4ef40d41f60 s3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
       via  61621009980 s3/libsmb: clang: Fix 'Value stored to 'p' is never read'
       via  764bb47a370 s3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
       via  4995a0e7e05 s3/libsmb: clang: Fix 'Value stored to 'create_options' is never read'
       via  25a256bedf2 s3/libsmb: clang: Fix 'Dereference of undefined pointer value'
       via  7a4da41c1ef s3/libsmd: clang: Fix some uninitialized value errors
       via  e9dd8821adf s3/libsmb: clang: Fix 'Value stored to 'p' is never read'
      from  6a9041ba437 autobuild: rename samba-ad-member-* to samba-admem-*

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


- Log -----------------------------------------------------------------
commit 6ebd0ba735e6fdddc4d7ded57879d85a42aabf05
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:57:22 2019 +0100

    s3/libsmb: clang: Fix 'the left operand of '-' is a garbage value'
    
    Fixes:
    
    source3/libsmb/clifile.c:360:19: warning: The left operand of '-' is a garbage value <--[clang]
            if (data[num_data-1] != '\0') {
                     ~~~~~~~~^
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Tue Oct 22 18:48:43 UTC 2019 on sn-devel-184

commit 4ef40d41f606f631411991101ed826733a74a8b7
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:55:13 2019 +0100

    s3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
    
    Fixes:
    
    source3/libsmb/clirap.c:1490:9: warning: Assigned value is garbage or undefined <--[clang]
                    *mode = attr;
                          ^ ~~~~
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 61621009980a4c4a8b64bde8e03370152df0cdce
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:52:46 2019 +0100

    s3/libsmb: clang: Fix 'Value stored to 'p' is never read'
    
    Fixes:
    
    source3/libsmb/clirap.c:145:3: warning: Value stored to 'p' is never read <--[clang]
                    p = rdata;
                    ^   ~~~~~
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 764bb47a370c6a5d5d73b8855d141c2d4cbd6f58
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:43:30 2019 +0100

    s3/libsmb: clang: Fix 'Assigned value is garbage or undefined'
    
    Fixes:
    
    source3/libsmb/smbsock_connect.c:786:13: warning: Assigned value is garbage or undefined <--[clang]
                    state->fd = fd;
                              ^ ~~
    1 warning generated.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 4995a0e7e05c4affc9f1f7992cef54e57d9efdc0
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:36:56 2019 +0100

    s3/libsmb: clang: Fix 'Value stored to 'create_options' is never read'
    
    It looks like the create_options are accumulated as the depending on the
    failure reasons returned for cli_smb2_create_fnum (except for when a
    directory is encountered) this looks like a mistake
    Fixes:
    
    source3/libsmb/cli_smb2_fnum.c:1870:3: warning: Value stored to 'create_options' is never read <--[clang]
                    create_options |= FILE_DIRECTORY_FILE;
                    ^
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 25a256bedf2992771b6ea1263fb5e730b27a53dc
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:27:35 2019 +0100

    s3/libsmb: clang: Fix 'Dereference of undefined pointer value'
    
    Fixes:
    
    source3/libsmb/clidfs.c:350:3: warning: Dereference of undefined pointer value <--[clang]
                    DLIST_ADD_END(referring_cli, cli);
                    ^
    1 warning generated.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 7a4da41c1efb62f5e528907a2e6c0aab766994e1
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:22:37 2019 +0100

    s3/libsmd: clang: Fix some uninitialized value errors
    
    Fixes:
    
    source3/libsmb/clilist.c:534:14: warning: 1st function call argument is an uninitialized value <--[clang]
            num_finfo = talloc_array_length(finfo);
                        ^
    source3/libsmb/clilist.c:1007:13: warning: The right operand of '<' is a garbage value <--[clang]
            for (i=0; i<num_finfo; i++) {
                       ^~~~~~~~~~
    2 warnings generated.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit e9dd8821adf1696f2ab292275cc0ee859e4a24c4
Author: Noel Power <noel.power at suse.com>
Date:   Tue Aug 13 15:18:10 2019 +0100

    s3/libsmb: clang: Fix 'Value stored to 'p' is never read'
    
    Fixes:
    
    source3/libsmb/climessage.c:73:2: warning: Value stored to 'p' is never read <--[clang]
            p += hlen;
            ^    ~~~~
    1 warning generated.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 source3/libsmb/cli_smb2_fnum.c   |  2 +-
 source3/libsmb/clidfs.c          | 10 +++++++++-
 source3/libsmb/clifile.c         |  4 ++--
 source3/libsmb/clilist.c         |  4 ++--
 source3/libsmb/climessage.c      |  1 -
 source3/libsmb/clirap.c          |  3 +--
 source3/libsmb/smbsock_connect.c |  4 ++--
 7 files changed, 17 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 535beaab841..15f1420dd8f 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -1876,7 +1876,7 @@ static NTSTATUS get_fnum_from_path(struct cli_state *cli,
 			FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
 			FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access */
 			FILE_OPEN,		/* create_disposition */
-			FILE_DIRECTORY_FILE,	/* create_options */
+			create_options,		/* create_options */
 			NULL,
 			pfnum,
 			NULL,
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index f617307bb03..ba851f3f471 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -333,7 +333,7 @@ static NTSTATUS cli_cm_connect(TALLOC_CTX *ctx,
 			       int name_type,
 			       struct cli_state **pcli)
 {
-	struct cli_state *cli;
+	struct cli_state *cli = NULL;
 	NTSTATUS status;
 
 	status = do_connect(ctx, server, share,
@@ -345,6 +345,14 @@ static NTSTATUS cli_cm_connect(TALLOC_CTX *ctx,
 		return status;
 	}
 
+	/*
+	 * This can't happen, this test is to satisfy static
+	 * checkers (clang)
+	 */
+	if (cli == NULL) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
 	/* Enter into the list. */
 	if (referring_cli) {
 		DLIST_ADD_END(referring_cli, cli);
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 987b04d0a66..dd08b0e30f3 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -344,7 +344,7 @@ static void cli_posix_readlink_done(struct tevent_req *subreq)
 		req, struct cli_posix_readlink_state);
 	NTSTATUS status;
 	uint8_t *data = NULL;
-	uint32_t num_data;
+	uint32_t num_data = 0;
 	charset_t charset;
 	size_t converted_size;
 	bool ok;
@@ -357,7 +357,7 @@ static void cli_posix_readlink_done(struct tevent_req *subreq)
 	/*
 	 * num_data is > 1, we've given 1 as minimum to cli_qpathinfo_send
 	 */
-	if (data[num_data-1] != '\0') {
+	if (data == NULL || data[num_data-1] != '\0') {
 		tevent_req_nterror(req, NT_STATUS_DATA_ERROR);
 		return;
 	}
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 5cb1fce4338..58dac65f4c7 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -506,7 +506,7 @@ NTSTATUS cli_list_old(struct cli_state *cli, const char *mask,
 	struct tevent_context *ev;
 	struct tevent_req *req;
 	NTSTATUS status = NT_STATUS_NO_MEMORY;
-	struct file_info *finfo;
+	struct file_info *finfo = NULL;
 	size_t i, num_finfo;
 
 	if (smbXcli_conn_has_async_calls(cli->conn)) {
@@ -967,7 +967,7 @@ NTSTATUS cli_list(struct cli_state *cli, const char *mask, uint16_t attribute,
 	struct tevent_req *req;
 	NTSTATUS status = NT_STATUS_NO_MEMORY;
 	struct file_info *finfo;
-	size_t i, num_finfo;
+	size_t i, num_finfo = 0;
 	uint16_t info_level;
 
 	if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c
index 5db01024183..fd21681ec72 100644
--- a/source3/libsmb/climessage.c
+++ b/source3/libsmb/climessage.c
@@ -70,7 +70,6 @@ static struct tevent_req *cli_message_start_send(TALLOC_CTX *mem_ctx,
 	p += ulen;
 	*p++ = 4;
 	memcpy(p, htmp, hlen);
-	p += hlen;
 	TALLOC_FREE(htmp);
 	TALLOC_FREE(utmp);
 
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index c0b9dcdff39..9fcda53573c 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -144,7 +144,6 @@ bool cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation)
                     &rdata, &rdrcnt                 /* return data, return size */
                    )) {
 		cli->rap_error = rparam? SVAL(rparam,0) : -1;
-		p = rdata;
 
 		if (cli->rap_error == 0) {
 			DEBUG(4,("NetWkstaUserLogon success\n"));
@@ -1479,7 +1478,7 @@ NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
 {
 	NTSTATUS status = NT_STATUS_OK;
 	SMB_STRUCT_STAT st = { 0 };
-	uint32_t attr;
+	uint32_t attr = 0;
 	uint64_t pos;
 
 	if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
diff --git a/source3/libsmb/smbsock_connect.c b/source3/libsmb/smbsock_connect.c
index be52b9a4f79..80ea743b388 100644
--- a/source3/libsmb/smbsock_connect.c
+++ b/source3/libsmb/smbsock_connect.c
@@ -757,8 +757,8 @@ static void smbsock_any_connect_connected(struct tevent_req *subreq)
 	struct smbsock_any_connect_state *state = tevent_req_data(
 		req, struct smbsock_any_connect_state);
 	NTSTATUS status;
-	int fd;
-	uint16_t chosen_port;
+	int fd = 0;
+	uint16_t chosen_port = 0;
 	size_t i;
 	size_t chosen_index = 0;
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list