We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d46ea57 commit 3feb7b0Copy full SHA for 3feb7b0
src/lib.rs
@@ -42,7 +42,13 @@ lazy_static! {
42
#[cfg(all(feature = "std", feature = "lender"))]
43
#[inline]
44
fn invalid_error_check<T>(pointer: *const T) -> Result<(), crate::error::PointerError> {
45
- if !LENT_POINTERS.read().unwrap().contains(&(pointer as usize)) {
+ if let Ok(lent_pointers) = LENT_POINTERS.read() {
46
+ if !lent_pointers.contains(&(pointer as usize)) {
47
+ log::error!("Using an invalid pointer as an opaque pointer to Rust's data");
48
+ return Err(crate::error::PointerError::Invalid);
49
+ }
50
+ } else {
51
+ log::error!("RwLock poisoned, it is not possible to check pointers");
52
return Err(crate::error::PointerError::Invalid);
53
}
54
return Ok(());
0 commit comments