aboutsummaryrefslogtreecommitdiff
path: root/src/node/psbt.cpp
diff options
context:
space:
mode:
authorAndrew Chow <[email protected]>2019-10-15 17:26:46 -0400
committerAndrew Chow <[email protected]>2020-01-06 12:57:21 -0500
commitdeaa6dd144f5650b385658a0c4f9a014aff8dde2 (patch)
tree21470cf99b54531eb03c5143cc3400e0495fdbfa /src/node/psbt.cpp
parentDon't calculate tx fees for PSBTs with invalid money values (diff)
downloaddiscoin-deaa6dd144f5650b385658a0c4f9a014aff8dde2.tar.xz
discoin-deaa6dd144f5650b385658a0c4f9a014aff8dde2.zip
psbt: check output index is within bounds before accessing
Diffstat (limited to 'src/node/psbt.cpp')
-rw-r--r--src/node/psbt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node/psbt.cpp b/src/node/psbt.cpp
index 69fb1a28a..ff7a38e40 100644
--- a/src/node/psbt.cpp
+++ b/src/node/psbt.cpp
@@ -39,6 +39,10 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
in_amt += utxo.nValue;
input_analysis.has_utxo = true;
} else {
+ if (input.non_witness_utxo && psbtx.tx->vin[i].prevout.n >= input.non_witness_utxo->vout.size()) {
+ result.SetInvalid(strprintf("PSBT is not valid. Input %u specifies invalid prevout", i));
+ return result;
+ }
input_analysis.has_utxo = false;
input_analysis.is_final = false;
input_analysis.next = PSBTRole::UPDATER;