Skip to content

Commit c50b218

Browse files
apoelstrareal-or-random
authored andcommitted
rangeproof: check that points deserialize correctly when verifying rangeproof
1 parent c33e597 commit c50b218

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/modules/rangeproof/rangeproof_impl.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,10 @@ SECP256K1_INLINE static int secp256k1_rangeproof_verify_impl(const secp256k1_ecm
609609
}
610610
for(i = 0; i < rings - 1; i++) {
611611
secp256k1_fe fe;
612-
secp256k1_fe_set_b32(&fe, &proof[offset]);
613-
secp256k1_ge_set_xquad(&c, &fe);
612+
if (!secp256k1_fe_set_b32(&fe, &proof[offset]) ||
613+
!secp256k1_ge_set_xquad(&c, &fe)) {
614+
return 0;
615+
}
614616
if (signs[i]) {
615617
secp256k1_ge_neg(&c, &c);
616618
}

0 commit comments

Comments
 (0)