Skip to content

Commit 19996d5

Browse files
authored
Fix altstack overflow in verify_digits for fixed-point edge case (#318)
1 parent 5691068 commit 19996d5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎bitvm/src/signatures/winternitz.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ impl Verifier for BruteforceVerifier {
469469
OP_DUP
470470
{ -1 }
471471
OP_NUMNOTEQUAL OP_VERIFY
472-
OP_FROMALTSTACK OP_DROP
472+
OP_FROMALTSTACK
473+
{ -1 } OP_EQUALVERIFY // Verify the sentinel value -1 to avoid altstack overflow in the rare case where pk == hash160^n(pk).
473474
OP_TOALTSTACK
474475
}
475476
}

0 commit comments

Comments
 (0)