Only accept UTF-8 directory entries

This commit is contained in:
topjohnwu
2025-04-15 00:19:28 -07:00
committed by John Wu
parent 92a42d901f
commit 7a207d4ccf
7 changed files with 50 additions and 55 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ use crate::consts::{ROOTMNT, ROOTOVL};
use crate::ffi::MagiskInit;
use base::libc::{O_CREAT, O_RDONLY, O_WRONLY};
use base::{
BufReadExt, Directory, FsPath, FsPathBuf, LoggedResult, ResultExt, Utf8CStr,
Utf8CString, clone_attr, cstr, cstr_buf, debug, path,
BufReadExt, Directory, FsPath, FsPathBuf, LoggedResult, ResultExt, Utf8CStr, Utf8CString,
clone_attr, cstr, cstr_buf, debug, path,
};
use std::io::BufReader;
use std::{
@@ -71,7 +71,7 @@ impl MagiskInit {
match &dir.read()? {
None => return Ok(()),
Some(e) => {
let name = e.name().to_str()?;
let name = e.name();
let src = FsPathBuf::from(cstr_buf::dynamic(256))
.join(src_dir)
.join(name);