From 576e4c7d0682103870acee87075716f424f71d90 Mon Sep 17 00:00:00 2001 From: Vhyrro Date: Mon, 13 Mar 2023 19:06:12 +0100 Subject: [PATCH] fix(rust_bindings): use-after-free for `Language::into_raw()` --- lib/binding_rust/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 568bad25..16e3cd4b 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -337,7 +337,7 @@ impl Language { /// Consumes the [Language], returning a raw pointer to the underlying C structure. pub fn into_raw(self) -> *const ffi::TSLanguage { - self.0 + ManuallyDrop::new(self).0 } }