mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 13:17:39 +02:00
Use memmem for finding needle in haystack
This commit is contained in:
@ -21,8 +21,8 @@ use base::libc::{
|
||||
S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR,
|
||||
};
|
||||
use base::{
|
||||
log_err, map_args, EarlyExitExt, FsPath, LoggedResult, MappedFile, ResultExt, Utf8CStr,
|
||||
WriteExt,
|
||||
log_err, map_args, BytesExt, EarlyExitExt, FsPath, LoggedResult, MappedFile, ResultExt,
|
||||
Utf8CStr, WriteExt,
|
||||
};
|
||||
|
||||
use crate::ffi::{unxz, xz};
|
||||
@ -246,7 +246,7 @@ impl Cpio {
|
||||
continue;
|
||||
}
|
||||
if name == "TRAILER!!!" {
|
||||
match data[pos..].windows(6).position(|x| x == b"070701") {
|
||||
match data[pos..].find(b"070701") {
|
||||
Some(x) => pos += x,
|
||||
None => break,
|
||||
}
|
||||
|
Reference in New Issue
Block a user