Fix UB shifting signed integer by 31 bits
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
parent
70f8c25bb7
commit
ed6ee30655
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a,
|
|||
|
||||
static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {
|
||||
if (flag && bit < 32)
|
||||
*r += (1 << bit);
|
||||
*r += (1U << bit);
|
||||
#ifdef VERIFY
|
||||
VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue