diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-09 11:19:27 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-09 11:19:29 -0400 |
commit | be00ef2aca0e5c350af0043af29428ac85dcca1d (patch) | |
tree | c013264a0cf14c63e86e6755f8044f30bb301778 /src | |
parent | 31b2ce70fb279e886da636716e45ec75bca0a711 (diff) | |
parent | fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8 (diff) |
Merge #18292: fuzz: Add assert(script == decompressed_script)
fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8 fuzz: Add assert(script == decompressed_script) (MarcoFalke)
Pull request description:
Presumably an oversight in https://github.com/bitcoin/bitcoin/pull/17926#discussion_r389262151
ACKs for top commit:
practicalswift:
Tested ACK fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8
Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/script.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index ed4fe21957..0d18784302 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -33,10 +33,12 @@ void test_one_input(const std::vector<uint8_t>& buffer) std::vector<unsigned char> compressed; if (CompressScript(script, compressed)) { const unsigned int size = compressed[0]; + compressed.erase(compressed.begin()); assert(size >= 0 && size <= 5); CScript decompressed_script; const bool ok = DecompressScript(decompressed_script, size, compressed); assert(ok); + assert(script == decompressed_script); } for (unsigned int size = 0; size < 6; ++size) { |