Skip to content
2 changes: 1 addition & 1 deletion fuzz/src/peer_crypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn do_test(data: &[u8]) {
Ok(len) => len,
Err(_) => return,
};
buf.copy_from_slice(&get_slice!(len as usize + 16));
buf[..len as usize + 16].copy_from_slice(&get_slice!(len as usize + 16));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ 16 might benefit from a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, its a fuzzer, it'll complain if its wrong :)

match crypter.decrypt_message(&mut buf[..len as usize + 16]) {
Ok(_) => {},
Err(_) => return,
Expand Down