Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2019-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#include <script/parsing.h>6#include <test/fuzz/FuzzedDataProvider.h>7#include <test/fuzz/fuzz.h>8#include <util/byte_units.h>9#include <util/string.h>11using util::Split;13FUZZ_TARGET(script_parsing)14{15FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());16const size_t query_size = fuzzed_data_provider.ConsumeIntegral<size_t>();17const std::string query = fuzzed_data_provider.ConsumeBytesAsString(std::min<size_t>(query_size, 1_MiB));18const std::string span_str = fuzzed_data_provider.ConsumeRemainingBytesAsString();19const std::span<const char> const_span{span_str};21std::span<const char> mut_span = const_span;22(void)script::Const(query, mut_span);24mut_span = const_span;25(void)script::Func(query, mut_span);27mut_span = const_span;28(void)script::Expr(mut_span);30if (!query.empty()) {31mut_span = const_span;32(void)Split(mut_span, query.front());33}34}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.