Skip to content

Commit

Permalink
[psbt] add file size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Mar 27, 2020
1 parent 1cd8dc2 commit 764bfe4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ static constexpr uint8_t PSBT_OUT_BIP32_DERIVATION = 0x02;
// as a 0 length key which indicates that this is the separator. The separator has no value.
static constexpr uint8_t PSBT_SEPARATOR = 0x00;

// BIP 174 does not specify a maximum file size, but we set a limit anyway
// to prevent reading a stream indefinately and running out of memory.
const std::streamsize MAX_FILE_SIZE_PSBT = 100000000; // 100 MiB

/** A structure for PSBTs which contain per-input information */
struct PSBTInput
{
Expand Down

0 comments on commit 764bfe4

Please sign in to comment.