From 8005b012ce89ff300ee6313a73afc6309526810a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 23 Jan 2015 19:24:42 +0100 Subject: Fix a use-after-free in Android get_proc_address. --- src/android/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/android/mod.rs b/src/android/mod.rs index bde2417..7c4f186 100644 --- a/src/android/mod.rs +++ b/src/android/mod.rs @@ -263,7 +263,8 @@ impl Window { } pub fn get_proc_address(&self, addr: &str) -> *const () { - let addr = CString::from_slice(addr.as_bytes()).as_slice_with_nul().as_ptr(); + let addr = CString::from_slice(addr.as_bytes()); + let addr = addr.as_slice_with_nul().as_ptr(); unsafe { ffi::egl::GetProcAddress(addr) as *const () } -- cgit v1.2.3