The branch, master has been updated
       via  8e1d72b7132 s4/torture: fix compilation in smb2/multichannel
       via  5e4e18d0c06 s4/torture/smb2/oplock: fix compilation by initialising 
variable
      from  57badc4638a s3: libsmb: Namecache. Fix bug missed by me in previous 
cleanup.

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


- Log -----------------------------------------------------------------
commit 8e1d72b7132763705a84f34d7cba9e3952514f2e
Author: Douglas Bagnall <[email protected]>
Date:   Tue Jul 14 22:49:51 2020 +1200

    s4/torture: fix compilation in smb2/multichannel
    
    GCC 9.3.0 doesn't like a true array being compared to NULL.
    
    [3628/3972] Compiling source4/torture/smb2/multichannel.c
    ../../source4/torture/smb2/multichannel.c:1077:7: error: comparison of 
array 'trees2' equal to a null pointer is always false 
[-Werror,-Wtautological-pointer-compare]
                    if (trees2 == NULL || trees2[i] == NULL) {
                        ^~~~~~    ~~~~
    ../../source4/torture/smb2/multichannel.c:1284:7: error: comparison of 
array 'trees2' equal to a null pointer is always false 
[-Werror,-Wtautological-pointer-compare]
                    if (trees2 == NULL || trees2[i] == NULL) {
                        ^~~~~~    ~~~~
    ../../source4/torture/smb2/multichannel.c:2337:7: error: comparison of 
array 'trees2' equal to a null pointer is always false 
[-Werror,-Wtautological-pointer-compare]
                    if (trees2 == NULL || trees2[i] == NULL) {
                        ^~~~~~    ~~~~
    3 errors generated.
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>
    
    Autobuild-User(master): Ralph Böhme <[email protected]>
    Autobuild-Date(master): Fri Jul 17 07:16:31 UTC 2020 on sn-devel-184

commit 5e4e18d0c0619fb407a12768caa8c7125ab30d42
Author: Douglas Bagnall <[email protected]>
Date:   Tue Jul 14 22:31:02 2020 +1200

    s4/torture/smb2/oplock: fix compilation by initialising variable
    
    With gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0:
    
    ../../source4/torture/smb2/oplock.c:2709:2: error: variable 'h2' is used 
uninitialized whenever 'if' condition is true 
[-Werror,-Wsometimes-uninitialized]
            torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "Incorrect 
status");
            
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../lib/torture/torture.h:734:3: note: expanded from macro 
'torture_assert_ntstatus_ok_goto'
                    
torture_assert_ntstatus_equal_goto(torture_ctx,expr,NT_STATUS_OK,ret,label,cmt)
                    
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../lib/torture/torture.h:302:6: note: expanded from macro 
'torture_assert_ntstatus_equal_goto'
            if (!NT_STATUS_EQUAL(__got, __expected)) { \
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../source4/torture/smb2/oplock.c:2730:25: note: uninitialized use occurs 
here
            smb2_util_close(tree1, h2);
                                   ^~
    ../../source4/torture/smb2/oplock.c:2709:2: note: remove the 'if' if its 
condition is always false
            torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "Incorrect 
status");
            ^
    ../../lib/torture/torture.h:734:3: note: expanded from macro 
'torture_assert_ntstatus_ok_goto'
                    
torture_assert_ntstatus_equal_goto(torture_ctx,expr,NT_STATUS_OK,ret,label,cmt)
                    ^
    ../../lib/torture/torture.h:302:2: note: expanded from macro 
'torture_assert_ntstatus_equal_goto'
            if (!NT_STATUS_EQUAL(__got, __expected)) { \
            ^
    ../../source4/torture/smb2/oplock.c:2652:2: note: variable 'h2' is declared 
here
            struct smb2_handle h, h1, h2;
            ^
    1 error generated.
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

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

Summary of changes:
 source4/torture/smb2/multichannel.c | 6 +++---
 source4/torture/smb2/oplock.c       | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/smb2/multichannel.c 
b/source4/torture/smb2/multichannel.c
index 7ff1945c316..332ee50382e 100644
--- a/source4/torture/smb2/multichannel.c
+++ b/source4/torture/smb2/multichannel.c
@@ -1074,7 +1074,7 @@ done:
        smb2_deltree(tree1, BASEDIR);
 
        for (i = 0; i < ARRAY_SIZE(trees2); i++) {
-               if (trees2 == NULL || trees2[i] == NULL) {
+               if (trees2[i] == NULL) {
                        continue;
                }
                TALLOC_FREE(trees2[i]);
@@ -1281,7 +1281,7 @@ done:
        smb2_deltree(tree1, BASEDIR);
 
        for (i = 0; i < ARRAY_SIZE(trees2); i++) {
-               if (trees2 == NULL || trees2[i] == NULL) {
+               if (trees2[i] == NULL) {
                        continue;
                }
                TALLOC_FREE(trees2[i]);
@@ -2334,7 +2334,7 @@ done:
        smb2_deltree(tree1, BASEDIR);
 
        for (i = 0; i < ARRAY_SIZE(trees2); i++) {
-               if (trees2 == NULL || trees2[i] == NULL) {
+               if (trees2[i] == NULL) {
                        continue;
                }
                TALLOC_FREE(trees2[i]);
diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c
index ef52a7cc381..a30657ef596 100644
--- a/source4/torture/smb2/oplock.c
+++ b/source4/torture/smb2/oplock.c
@@ -2649,7 +2649,7 @@ static bool test_smb2_oplock_batch22b(struct 
torture_context *tctx,
        NTSTATUS status;
        bool ret = true;
        union smb_open io;
-       struct smb2_handle h, h1, h2;
+       struct smb2_handle h, h1, h2 = {{0}};
        struct timeval tv;
        int timeout = torture_setting_int(tctx, "oplocktimeout", 35);
        struct smb2_transport *transport1 = tree1->session->transport;
@@ -2727,7 +2727,9 @@ done:
        test_cleanup_blocked_transports(tctx);
 
        smb2_util_close(tree1, h1);
-       smb2_util_close(tree1, h2);
+       if (!smb2_util_handle_empty(h2)) {
+               smb2_util_close(tree1, h2);
+       }
        smb2_util_close(tree1, h);
 
        smb2_deltree(tree1, BASEDIR);


-- 
Samba Shared Repository

Reply via email to