Stronger types for >= 16 bits shifts
This commit is contained in:
parent
ca71815db3
commit
531c51e7a3
@ -180,7 +180,7 @@ static const char *from_base64(void *dst, size_t *dst_len, const char *src) {
|
||||
* otherwise, only 0, 2 or 4 bits are buffered. The buffered
|
||||
* bits must also all be zero.
|
||||
*/
|
||||
if (acc_len > 4 || (acc & (((unsigned)1 << acc_len) - 1)) != 0) {
|
||||
if (acc_len > 4 || (acc & ((1U << acc_len) - 1)) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
*dst_len = len;
|
||||
|
@ -275,7 +275,7 @@ escrypt_kdf_nosse(escrypt_local_t * local,
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) {
|
||||
if ((uint64_t)(r) * (uint64_t)(p) >= ((uint64_t) 1 << 30)) {
|
||||
errno = EFBIG;
|
||||
return -1;
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ escrypt_kdf_sse(escrypt_local_t * local,
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) {
|
||||
if ((uint64_t)(r) * (uint64_t)(p) >= ((uint64_t) 1 << 30)) {
|
||||
errno = EFBIG;
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user