From 6d4f64f9010d5bf66cb44f4686e1f5ca723dd06d Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 14 Feb 2018 16:25:45 +0000 Subject: [PATCH] fix potential unsafety bug for non-u8 types in macros We don't have any non-u8 newtypes but better safe than sorry. See https://github.com/apoelstra/rust-bitcoin/pull/45/ --- Cargo.toml | 2 +- src/macros.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index de6f874..8e960f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "secp256k1" -version = "0.8.1" +version = "0.8.2" authors = [ "Dawid Ciężarkiewicz ", "Andrew Poelstra " ] license = "CC0-1.0" diff --git a/src/macros.rs b/src/macros.rs index 92eccbf..4318ae0 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -60,7 +60,7 @@ macro_rules! impl_array_newtype { let mut ret: $thing = mem::uninitialized(); copy_nonoverlapping(self.as_ptr(), ret.as_mut_ptr(), - mem::size_of::<$thing>()); + $len); ret } }