From: Matt Corallo Date: Wed, 31 Jan 2024 19:48:44 +0000 (+0000) Subject: [fuzz] Fix slice copy in `peer_crypt_target` X-Git-Tag: v0.0.123-beta~80^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2023-12-arbitrary-fuzz-config;p=rust-lightning [fuzz] Fix slice copy in `peer_crypt_target` This has apparently been broken for quite some time...I guess `peer_crypt_target` doesn't get much CPU anymore. --- diff --git a/fuzz/src/peer_crypt.rs b/fuzz/src/peer_crypt.rs index 3acf4d664..41d8c0936 100644 --- a/fuzz/src/peer_crypt.rs +++ b/fuzz/src/peer_crypt.rs @@ -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)); match crypter.decrypt_message(&mut buf[..len as usize + 16]) { Ok(_) => {}, Err(_) => return,