mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-21 09:22:18 +02:00
fuzz: Limit script_format to 100kB
This commit is contained in:
parent
ee8c997125
commit
bbbbeaf9c8
@ -3,7 +3,9 @@
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <consensus/consensus.h>
|
||||
#include <core_io.h>
|
||||
#include <policy/policy.h>
|
||||
#include <script/script.h>
|
||||
#include <test/fuzz/FuzzedDataProvider.h>
|
||||
#include <test/fuzz/fuzz.h>
|
||||
@ -19,6 +21,9 @@ FUZZ_TARGET_INIT(script_format, initialize_script_format)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
const CScript script{ConsumeScript(fuzzed_data_provider)};
|
||||
if (script.size() > MAX_STANDARD_TX_WEIGHT / WITNESS_SCALE_FACTOR) {
|
||||
return;
|
||||
}
|
||||
|
||||
(void)FormatScript(script);
|
||||
(void)ScriptToAsmStr(script, /*fAttemptSighashDecode=*/fuzzed_data_provider.ConsumeBool());
|
||||
|
Loading…
x
Reference in New Issue
Block a user