mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Ensure that input witness is present before accessing range proofs
This commit is contained in:
parent
670229e060
commit
42b62ac285
1 changed files with 6 additions and 0 deletions
|
|
@ -854,6 +854,9 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve
|
|||
return false;
|
||||
}
|
||||
if (!issuance.nAmount.IsNull()) {
|
||||
if (i >= tx.wit.vtxinwit.size()) {
|
||||
return false;
|
||||
}
|
||||
if (!VerifyIssuanceAmount(commit, gen, assetID, issuance.nAmount, tx.wit.vtxinwit[i].vchIssuanceAmountRangeproof, pvChecks, cacheStore)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -878,6 +881,9 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve
|
|||
return false;
|
||||
}
|
||||
|
||||
if (i >= tx.wit.vtxinwit.size()) {
|
||||
return false;
|
||||
}
|
||||
if (!VerifyIssuanceAmount(commit, gen, assetTokenID, issuance.nInflationKeys, tx.wit.vtxinwit[i].vchInflationKeysRangeproof, pvChecks, cacheStore)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue