File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ FUZZ_TARGETS = \
47
47
test/fuzz/spanparsing \
48
48
test/fuzz/sub_net_deserialize \
49
49
test/fuzz/transaction \
50
+ test/fuzz/tx_in \
50
51
test/fuzz/tx_in_deserialize \
51
52
test/fuzz/txoutcompressor_deserialize \
52
53
test/fuzz/txundo_deserialize
@@ -497,6 +498,12 @@ test_fuzz_tx_in_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
497
498
test_fuzz_tx_in_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
498
499
test_fuzz_tx_in_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
499
500
501
+ test_fuzz_tx_in_SOURCES = $(FUZZ_SUITE) test/fuzz/tx_in.cpp
502
+ test_fuzz_tx_in_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
503
+ test_fuzz_tx_in_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
504
+ test_fuzz_tx_in_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
505
+ test_fuzz_tx_in_LDADD = $(FUZZ_SUITE_LD_COMMON)
506
+
500
507
endif # ENABLE_FUZZ
501
508
502
509
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 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 < consensus/validation.h>
6
+ #include < core_memusage.h>
7
+ #include < policy/policy.h>
8
+ #include < primitives/transaction.h>
9
+ #include < streams.h>
10
+ #include < test/fuzz/fuzz.h>
11
+ #include < version.h>
12
+
13
+ #include < cassert>
14
+
15
+ void test_one_input (const std::vector<uint8_t >& buffer)
16
+ {
17
+ CDataStream ds (buffer, SER_NETWORK, INIT_PROTO_VERSION);
18
+ CTxIn tx_in;
19
+ try {
20
+ int version;
21
+ ds >> version;
22
+ ds.SetVersion (version);
23
+ ds >> tx_in;
24
+ } catch (const std::ios_base::failure&) {
25
+ return ;
26
+ }
27
+
28
+ (void )GetTransactionInputWeight (tx_in);
29
+ (void )GetVirtualTransactionInputSize (tx_in);
30
+ (void )RecursiveDynamicUsage (tx_in);
31
+
32
+ (void )tx_in.ToString ();
33
+ }
You can’t perform that action at this time.
0 commit comments