1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

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>
This commit is contained in:
Noel Power 2019-05-22 11:29:33 +00:00 committed by Andreas Schneider
parent bb00a7e018
commit 90a82a41cf

View File

@ -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;
}