diff options
author | Noel Power <noel.power@suse.com> | 2019-05-22 11:29:33 +0000 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-04 22:13:07 +0000 |
commit | 90a82a41cfd6981397aa5c4e4b462bf14e57cd66 (patch) | |
tree | 4ede1c976a74bea62c612845ba92d8ac3bc6d1ef /source4/torture | |
parent | bb00a7e018800c6d70d9d0937183961c7af970b9 (diff) | |
download | samba-90a82a41cfd6981397aa5c4e4b462bf14e57cd66.tar.gz |
s4/torture/raw: cppcheck: Fix shiftTooManyBitsSigned error
Fix
source4/torture/raw/open.c:1009: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/raw/open.c:1048: 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/torture')
-rw-r--r-- | source4/torture/raw/open.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index 5e8c81c9d07..220313ed83d 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -1006,7 +1006,8 @@ static bool test_nttrans_create(struct torture_context *tctx, struct smbcli_stat /* Check some create options (these all should be ignored) */ for (i=0; i < 32; i++) { - uint32_t create_option = (1 << i) & NTCREATEX_OPTIONS_MUST_IGNORE_MASK; + uint32_t create_option = + ((uint32_t)1 << i) & NTCREATEX_OPTIONS_MUST_IGNORE_MASK; if (create_option == 0) { continue; } @@ -1045,7 +1046,7 @@ static bool test_nttrans_create(struct torture_context *tctx, struct smbcli_stat not_a_directory_mask = 0; unexpected_mask = 0; for (i=0; i < 32; i++) { - uint32_t create_option = 1<<i; + uint32_t create_option = (uint32_t)1<<i; if (create_option & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) { continue; } |