File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ FUZZ_TARGETS = \
38
38
test/fuzz/partial_merkle_tree_deserialize \
39
39
test/fuzz/partially_signed_transaction_deserialize \
40
40
test/fuzz/prefilled_transaction_deserialize \
41
+ test/fuzz/parse_script \
41
42
test/fuzz/psbt \
42
43
test/fuzz/psbt_input_deserialize \
43
44
test/fuzz/psbt_output_deserialize \
@@ -525,6 +526,12 @@ test_fuzz_parse_hd_keypath_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
525
526
test_fuzz_parse_hd_keypath_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
526
527
test_fuzz_parse_hd_keypath_LDADD = $(FUZZ_SUITE_LD_COMMON)
527
528
529
+ test_fuzz_parse_script_SOURCES = $(FUZZ_SUITE) test/fuzz/parse_script.cpp
530
+ test_fuzz_parse_script_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
531
+ test_fuzz_parse_script_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
532
+ test_fuzz_parse_script_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
533
+ test_fuzz_parse_script_LDADD = $(FUZZ_SUITE_LD_COMMON)
534
+
528
535
endif # ENABLE_FUZZ
529
536
530
537
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2009-2019 The Bitcoin Core developers
2
+ // Distributed under the MIT software license, see the accompanying
3
+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
5
+ #include < core_io.h>
6
+ #include < script/script.h>
7
+ #include < test/fuzz/fuzz.h>
8
+
9
+ void test_one_input (const std::vector<uint8_t >& buffer)
10
+ {
11
+ const std::string script_string (buffer.begin (), buffer.end ());
12
+ try {
13
+ (void )ParseScript (script_string);
14
+ } catch (const std::runtime_error&) {
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments