From fdf36686631a53f80c092664e56e6aeeac83513b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20Bl=C3=B6cher?= Date: Wed, 27 May 2026 11:09:08 +0100 Subject: [PATCH] Fix dangling pointer in `X509StoreContextRef::set_verify_param` `param` is dropped at the end of the function after its pointer was taken via `.as_ptr()`. Instead, `param` should be converted into a pointer via `.into_ptr()` without being dropped. --- boring/src/x509/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boring/src/x509/mod.rs b/boring/src/x509/mod.rs index 8401813be..3134f703f 100644 --- a/boring/src/x509/mod.rs +++ b/boring/src/x509/mod.rs @@ -247,7 +247,7 @@ impl X509StoreContextRef { /// Sets the X509 verification configuration. #[corresponds(X509_STORE_CTX_set0_param)] pub fn set_verify_param(&mut self, param: X509VerifyParam) { - unsafe { ffi::X509_STORE_CTX_set0_param(self.as_ptr(), param.as_ptr()) } + unsafe { ffi::X509_STORE_CTX_set0_param(self.as_ptr(), param.into_ptr()) } } /// Verifies the stored certificate.