Skip to content

Commit 29b4a3e

Browse files
authored
fix: Ensure Vec capacity equals length in custom_actions to avoid UB on free (#82)
1 parent c07ddbc commit 29b4a3e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ impl From<&[CustomAction]> for custom_actions {
777777
.iter()
778778
.map(|action| BoxCastPtr::to_mut_ptr(action.clone()))
779779
.collect();
780+
ffi_values.shrink_to_fit();
780781
let array = Self {
781782
length,
782783
values: ffi_values.as_mut_ptr(),

0 commit comments

Comments
 (0)