mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
luks2: fix warning undefined shift
Explicitly set uint32_t for shift, found by clang undefined sanitizer. Undefine shift cannot happen in reality, though.
This commit is contained in:
@@ -625,7 +625,7 @@ static bool token_is_blocked(int token, uint32_t *block_list)
|
||||
/* it is safe now, but have assert in case LUKS2_TOKENS_MAX grows */
|
||||
assert(token >= 0 && (size_t)token < BITFIELD_SIZE(block_list));
|
||||
|
||||
return (*block_list & (1 << token));
|
||||
return (*block_list & (UINT32_C(1) << token));
|
||||
}
|
||||
|
||||
static void token_block(int token, uint32_t *block_list)
|
||||
@@ -633,7 +633,7 @@ static void token_block(int token, uint32_t *block_list)
|
||||
/* it is safe now, but have assert in case LUKS2_TOKENS_MAX grows */
|
||||
assert(token >= 0 && (size_t)token < BITFIELD_SIZE(block_list));
|
||||
|
||||
*block_list |= (1 << token);
|
||||
*block_list |= (UINT32_C(1) << token);
|
||||
}
|
||||
|
||||
static int token_open_priority(struct crypt_device *cd,
|
||||
|
||||
Reference in New Issue
Block a user