Skip to content

Commit 694d926

Browse files
committed
Merge rust-bitcoin#4209: Fix fuzz targets
ddb6dd5 Move module out of fuzz_target directory (Jamil Lambert, PhD) Pull request description: rust-bitcoin#4185 introduced a new file `fuzz/fuzz_targets/bitcoin/fuzz_utils.rs` which is not a valid fuzz target. This causes the daily fuzz workflow to fail on `verify-execution`. Move the module to the `src/` directory. Create a `lib.rs` file. ACKs for top commit: brunoerg: ACK ddb6dd5 tcharding: ACK ddb6dd5 Tree-SHA512: da05ab92cbb934ee90c2dc11b9edbb95e6ae66cbbeec1481ff2e2d225b43c59a7bf75a22578ca3f62c9fdda2ad195159e8a8d45529948382369a85c8718954b3
2 parents aefcf2b + ddb6dd5 commit 694d926

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

fuzz/fuzz_targets/bitcoin/deserialize_psbt.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use honggfuzz::fuzz;
22

3-
mod fuzz_utils;
4-
use fuzz_utils::consume_random_bytes;
3+
use bitcoin_fuzz::fuzz_utils::consume_random_bytes;
54

65
fn do_test(data: &[u8]) {
76
let mut new_data = data;

fuzz/fuzz_targets/bitcoin/deserialize_script.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use bitcoin::script::{self, ScriptExt as _};
44
use bitcoin::{FeeRate, Network};
55
use honggfuzz::fuzz;
66

7-
mod fuzz_utils;
8-
use fuzz_utils::{consume_random_bytes, consume_u64};
7+
use bitcoin_fuzz::fuzz_utils::{consume_random_bytes, consume_u64};
98

109
fn do_test(data: &[u8]) {
1110
let mut new_data = data;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! Helper functions for fuzzing.
4+
15
pub fn consume_random_bytes<'a>(data: &mut &'a [u8]) -> &'a [u8] {
26
if data.is_empty() {
37
return &[];

fuzz/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! # Fuzzing
4+
5+
pub mod fuzz_utils;

0 commit comments

Comments
 (0)