diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index f13938c4..6666ef95 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -682,7 +682,7 @@ sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf, is_barrier = (( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U; acc |= c; - pad_len |= (i & - is_barrier); + pad_len |= i & (1U + ~is_barrier); valid |= (unsigned char) is_barrier; } *unpadded_buflen_p = padded_buflen - 1U - pad_len;