diff options
| author | Sjors Provoost <[email protected]> | 2020-03-26 11:18:52 +0100 |
|---|---|---|
| committer | Sjors Provoost <[email protected]> | 2020-03-27 14:59:19 +0100 |
| commit | 764bfe4cba35c24f7627cc425d9e7eba56e98964 (patch) | |
| tree | ba28bee5ce038c9b3e40805cd07d1caffe26322d /src | |
| parent | [gui] load PSBT (diff) | |
| download | discoin-764bfe4cba35c24f7627cc425d9e7eba56e98964.tar.xz discoin-764bfe4cba35c24f7627cc425d9e7eba56e98964.zip | |
[psbt] add file size limit
Diffstat (limited to 'src')
| -rw-r--r-- | src/psbt.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/psbt.h b/src/psbt.h index dfba26196..7ea06b38f 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -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 { |