From 9052f3b5a2001f526490685aae6903612ccf1c19 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 13 Feb 2018 19:08:10 -0500 Subject: [PATCH] Fix argument to copy_nonoverlapping in internal_macros This resolves a segfault due to unsafe code. --- src/internal_macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal_macros.rs b/src/internal_macros.rs index a756da7e56..69018a4f8e 100644 --- a/src/internal_macros.rs +++ b/src/internal_macros.rs @@ -88,7 +88,7 @@ macro_rules! impl_array_newtype { let mut ret: $thing = mem::uninitialized(); copy_nonoverlapping(data.as_ptr(), ret.as_mut_ptr(), - mem::size_of::<$thing>()); + $len); ret } }