mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
fuzz: Limit script_format to 100kB
This commit is contained in:
parent
ee8c997125
commit
bbbbeaf9c8
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue