mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 08:01:26 +00:00
android: avoid UAF
This commit is contained in:
1 parent
15cc8f9d2d
commit
3bbb5f7955
1 file changed
+2
-5
@@ -37,13 +37,10 @@ fn log_out(data: &[u8]) {
|
||||
Ok(s) => s,
|
||||
Err(_) => return,
|
||||
};
|
||||
const ANDROID_LOG_TAG: &str = "leaf";
|
||||
let tag = ffi::CString::new("leaf").unwrap();
|
||||
let _ = __android_log_print(
|
||||
android_LogPriority_ANDROID_LOG_VERBOSE as std::os::raw::c_int,
|
||||
ffi::CString::new(ANDROID_LOG_TAG)
|
||||
.unwrap()
|
||||
.as_c_str()
|
||||
.as_ptr(),
|
||||
tag.as_c_str().as_ptr(),
|
||||
s.as_c_str().as_ptr(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user