Skip to content

Commit

Permalink
Merge pull request #82 from iron-fish/fix/hughy/decrypt-legacy-alloca…
Browse files Browse the repository at this point in the history
…tion

do not pre-allocate vector capacity in MultiRecipientBlob
  • Loading branch information
hughy authored Sep 13, 2024
2 parents d0712d8 + 6630389 commit 06f16dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/multienc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl MultiRecipientBlob<Vec<EncryptedKey>, Vec<u8>> {
reader.read_exact(&mut encrypted_keys_len)?;
let encrypted_keys_len = u32::from_le_bytes(encrypted_keys_len) as usize;

let mut encrypted_keys = Vec::with_capacity(encrypted_keys_len);
let mut encrypted_keys = Vec::new();
for _ in 0..encrypted_keys_len {
let mut key = EncryptedKey::default();
reader.read_exact(&mut key)?;
Expand Down

0 comments on commit 06f16dd

Please sign in to comment.