diff options
author | Noel Power <noel.power@suse.com> | 2019-05-22 12:03:36 +0000 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-04 22:13:07 +0000 |
commit | c8cdc016b4c53109454f25ee675d083b556cc134 (patch) | |
tree | 7afd5c82c5525c119610ed3c722e25c4b8d8418d /source4 | |
parent | 90a82a41cfd6981397aa5c4e4b462bf14e57cd66 (diff) | |
download | samba-c8cdc016b4c53109454f25ee675d083b556cc134.tar.gz |
s4/torture/smb2: cppcheck: Fix shiftTooManyBitsSigned error
Fixes
source4/torture/smb2/create.c:197: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/create.c:234: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/smb2/create.c:265: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/smb2/create.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c index 0ede6add54a..9b32062ab07 100644 --- a/source4/torture/smb2/create.c +++ b/source4/torture/smb2/create.c @@ -194,7 +194,7 @@ static bool test_create_gentest(struct torture_context *tctx, struct smb2_tree * { int i; for (i=0;i<32;i++) { - io.in.create_options = 1<<i; + io.in.create_options = (uint32_t)1<<i; if (io.in.create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) { continue; } @@ -231,7 +231,7 @@ static bool test_create_gentest(struct torture_context *tctx, struct smb2_tree * { int i; for (i=0;i<32;i++) { - io.in.desired_access = 1<<i; + io.in.desired_access = (uint32_t)1<<i; status = smb2_create(tree, tctx, &io); if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) || NT_STATUS_EQUAL(status, NT_STATUS_PRIVILEGE_NOT_HELD)) { @@ -262,7 +262,7 @@ static bool test_create_gentest(struct torture_context *tctx, struct smb2_tree * { int i; for (i=0;i<32;i++) { - io.in.file_attributes = 1<<i; + io.in.file_attributes = (uint32_t)1<<i; if (io.in.file_attributes & FILE_ATTRIBUTE_ENCRYPTED) { continue; } |