Skip to content

Commit 8a52a61

Browse files
committed
ext/sodium: avoid negations on unsigned values
1 parent 95870dc commit 8a52a61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/sodium/libsodium.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3284,7 +3284,7 @@ PHP_FUNCTION(sodium_unpad)
32843284
is_barrier =
32853285
(( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U;
32863286
acc |= c;
3287-
pad_len |= (i & - is_barrier);
3287+
pad_len |= i & (1U + ~is_barrier);
32883288
valid |= (unsigned char) is_barrier;
32893289
}
32903290
unpadded_len = padded_len - 1U - pad_len;

0 commit comments

Comments
 (0)