aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/stack.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-03-09 20:28:42 +1100
committerGitHub <[email protected]>2017-03-09 20:28:42 +1100
commitefe96396ad7e62327adb0af0664aec7ad28b1bc5 (patch)
tree9b6f271b7d23aae057b185959c8e3ee87c2419ce /openssl/src/stack.rs
parentMerge pull request #585 from bluejekyll/master (diff)
parentDon't allow Stacks to be allocated with a null-ptr (diff)
downloadrust-openssl-efe96396ad7e62327adb0af0664aec7ad28b1bc5.tar.xz
rust-openssl-efe96396ad7e62327adb0af0664aec7ad28b1bc5.zip
Merge pull request #592 from Byron/master
Fix for len() == isize::max() for stacks that are unallocated
Diffstat (limited to 'openssl/src/stack.rs')
-rw-r--r--openssl/src/stack.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/openssl/src/stack.rs b/openssl/src/stack.rs
index 268afde7..6ac8264c 100644
--- a/openssl/src/stack.rs
+++ b/openssl/src/stack.rs
@@ -86,6 +86,8 @@ impl<T: Stackable> ForeignType for Stack<T> {
#[inline]
unsafe fn from_ptr(ptr: *mut T::StackType) -> Stack<T> {
+ assert!(!ptr.is_null(), "Must not instantiate a Stack from a null-ptr - use Stack::new() in \
+ that case");
Stack(ptr)
}