Skip to content

Commit 2a42e9b

Browse files
authored
Fix broken copy_from_slice (#295)
1 parent 05ba8df commit 2a42e9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boringtun/src/noise/rate_limiter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl RateLimiter {
135135

136136
let iv = GenericArray::from_slice(nonce);
137137

138-
encrypted_cookie.copy_from_slice(&cookie);
138+
encrypted_cookie[..16].copy_from_slice(&cookie);
139139
let tag = cipher
140140
.encrypt_in_place_detached(iv, mac1, &mut encrypted_cookie[..16])
141141
.map_err(|_| WireGuardError::DestinationBufferTooSmall)?;

0 commit comments

Comments
 (0)