From 35779863c4d745e8ec22410af2c2fc7ca40ace22 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 23 Sep 2024 15:59:06 +0200 Subject: [PATCH] Bring back placeholder value in CommandExecutor to fix #2541 (#2543) --- libafl/src/executors/command.rs | 5 +++-- libafl/src/observers/concolic/serialization_format.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libafl/src/executors/command.rs b/libafl/src/executors/command.rs index 5854414f8d..72a87d05c8 100644 --- a/libafl/src/executors/command.rs +++ b/libafl/src/executors/command.rs @@ -105,7 +105,7 @@ where for (i, arg) in args.enumerate() { if i == *argnum { - debug_assert_eq!(arg, "DUMMY"); + debug_assert_eq!(arg, "PLACEHOLDER"); #[cfg(unix)] cmd.arg(OsStr::from_bytes(input.target_bytes().as_slice())); // There is an issue here that the chars on Windows are 16 bit wide. @@ -379,7 +379,8 @@ impl CommandExecutorBuilder { pub fn arg_input_arg(&mut self) -> &mut Self { let argnum = self.args.len(); self.input(InputLocation::Arg { argnum }); - // self.arg("DUMMY"); + // Placeholder arg that gets replaced with the input name later. + self.arg("PLACEHOLDER"); self } diff --git a/libafl/src/observers/concolic/serialization_format.rs b/libafl/src/observers/concolic/serialization_format.rs index a72213a05e..72735bb702 100644 --- a/libafl/src/observers/concolic/serialization_format.rs +++ b/libafl/src/observers/concolic/serialization_format.rs @@ -242,7 +242,7 @@ impl MessageFileWriter { /// Create a `MessageFileWriter` from the given [`Write`]. pub fn from_writer(mut writer: W) -> io::Result { let writer_start_position = writer.stream_position()?; - // write dummy trace length + // write preliminary trace length writer.write_all(&0_u64.to_le_bytes())?; Ok(Self { id_counter: 1,