mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-06-02 06:23:34 +02:00
Add streaming CPIO reader and writer
The Magisk boot image patcher still reads all the entries into memory for simplicity, but everything else now uses the streaming reader. Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#[cfg(not(windows))]
|
||||
mod fuzz {
|
||||
use std::io::Cursor;
|
||||
use std::{io::Cursor, sync::atomic::AtomicBool};
|
||||
|
||||
use avbroot::format::cpio;
|
||||
use honggfuzz::fuzz;
|
||||
@@ -8,8 +8,9 @@ mod fuzz {
|
||||
pub fn main() {
|
||||
loop {
|
||||
fuzz!(|data: &[u8]| {
|
||||
let cancel_signal = AtomicBool::new(false);
|
||||
let reader = Cursor::new(data);
|
||||
let _ = cpio::load(reader, true);
|
||||
let _ = cpio::load(reader, true, &cancel_signal);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user