Skip to content

Commit a594449

Browse files
Fix router fuzz failure due to LengthLimitedReader
We recently switched the decode_msg macro in the router fuzz target from reading from a Cursor to reading from a slice. This caused a failure because the slice advances its pointer as it is being read from, so asserting that the length of the slice is equal to the length of the message that was read no longer works. Instead assert that the original fuzz data length is equal to the length of the message that was read.
1 parent 8b3f6cc commit a594449

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fuzz/src/router.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
150150
let mut reader = &data[..];
151151
match <$MsgType>::read_from_fixed_length_buffer(&mut reader) {
152152
Ok(msg) => {
153-
assert_eq!(reader.len(), $len);
153+
assert_eq!(data.len(), $len);
154154
msg
155155
},
156156
Err(e) => match e {

0 commit comments

Comments
 (0)