From 7377cc99c7ae959a5d33fd170ff5b2b64c725fd2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 31 Jan 2024 19:48:44 +0000 Subject: [PATCH] [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. --- fuzz/src/peer_crypt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.39.5