parent
32963be453
commit
084b9b5878
@ -53,7 +53,7 @@ use libafl_targets::{
|
||||
libfuzzer_initialize, libfuzzer_test_one_input, std_edges_map_observer, CmpLogObserver,
|
||||
};
|
||||
#[cfg(unix)]
|
||||
use nix::{self, unistd::dup};
|
||||
use nix::unistd::dup;
|
||||
|
||||
/// The fuzzer main (as `no_mangle` C function)
|
||||
#[no_mangle]
|
||||
|
@ -55,7 +55,7 @@ use libafl_qemu::{
|
||||
QemuShutdownCause, Regs,
|
||||
};
|
||||
#[cfg(unix)]
|
||||
use nix::{self, unistd::dup};
|
||||
use nix::unistd::dup;
|
||||
|
||||
/// The fuzzer main
|
||||
pub fn main() {
|
||||
|
@ -65,7 +65,7 @@ use libafl_qemu::{
|
||||
Regs,
|
||||
};
|
||||
#[cfg(unix)]
|
||||
use nix::{self, unistd::dup};
|
||||
use nix::unistd::dup;
|
||||
|
||||
pub const MAX_INPUT_SIZE: usize = 1048576; // 1MB
|
||||
|
||||
|
@ -59,7 +59,7 @@ use libafl_targets::{
|
||||
libfuzzer_initialize, libfuzzer_test_one_input, std_edges_map_observer, CmpLogObserver,
|
||||
};
|
||||
#[cfg(unix)]
|
||||
use nix::{self, unistd::dup};
|
||||
use nix::unistd::dup;
|
||||
|
||||
/// The fuzzer main (as `no_mangle` C function)
|
||||
#[no_mangle]
|
||||
|
@ -325,6 +325,7 @@ impl TimerStruct {
|
||||
if self.batch_mode {
|
||||
unsafe {
|
||||
let elapsed = current_time().saturating_sub(self.tmout_start_time);
|
||||
let elapsed_since_signal = current_time().saturating_sub(self.tmout_start_time);
|
||||
// elapsed may be > than tmout in case of received but ingored signal
|
||||
if elapsed > self.exec_tmout
|
||||
|| self.exec_tmout.saturating_sub(elapsed) < self.avg_exec_time * self.avg_mul_k
|
||||
@ -337,8 +338,7 @@ impl TimerStruct {
|
||||
self.executions = 0;
|
||||
}
|
||||
// readjust K
|
||||
if self.last_signal_time > self.exec_tmout * self.avg_mul_k
|
||||
&& self.avg_mul_k > 1
|
||||
if elapsed_since_signal > self.exec_tmout * self.avg_mul_k && self.avg_mul_k > 1
|
||||
{
|
||||
self.avg_mul_k -= 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user