mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 23:01:30 +11:00
Merge pull request #223 from Ms2ger/CString
Fix a use-after-free in Android get_proc_address.
This commit is contained in:
commit
bd3d7513f8
|
@ -263,7 +263,8 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_proc_address(&self, addr: &str) -> *const () {
|
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 {
|
unsafe {
|
||||||
ffi::egl::GetProcAddress(addr) as *const ()
|
ffi::egl::GetProcAddress(addr) as *const ()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue