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/
This commit is contained in:
Andrew Poelstra 2018-02-14 16:25:45 +00:00
parent f14e747431
commit 6d4f64f901
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[package] [package]
name = "secp256k1" name = "secp256k1"
version = "0.8.1" version = "0.8.2"
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>", authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
"Andrew Poelstra <apoelstra@wpsoftware.net>" ] "Andrew Poelstra <apoelstra@wpsoftware.net>" ]
license = "CC0-1.0" license = "CC0-1.0"

View File

@ -60,7 +60,7 @@ macro_rules! impl_array_newtype {
let mut ret: $thing = mem::uninitialized(); let mut ret: $thing = mem::uninitialized();
copy_nonoverlapping(self.as_ptr(), copy_nonoverlapping(self.as_ptr(),
ret.as_mut_ptr(), ret.as_mut_ptr(),
mem::size_of::<$thing>()); $len);
ret ret
} }
} }