Skip to content

Commit 468a999

Browse files
committed
Add casr-lua to casr-libfuzzer
1 parent 8383a9d commit 468a999

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

casr/src/bin/casr-libfuzzer.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ fn main() -> Result<()> {
161161
|| argv[0].ends_with("jsfuzz"))
162162
{
163163
"casr-js"
164+
} else if hint == "lua"
165+
|| hint == "auto"
166+
&& (argv[0].ends_with(".lua")
167+
|| argv[0] == "lua"
168+
|| argv[0] == "luajit"
169+
|| argv.len() > 1 && argv[1].ends_with(".lua"))
170+
{
171+
"casr-lua"
164172
} else {
165173
let sym_list = util::symbols_list(Path::new(argv[0]))?;
166174
if hint == "san"
@@ -203,7 +211,7 @@ fn main() -> Result<()> {
203211
// Get input file argument index.
204212
let at_index = if let Some(idx) = argv.iter().skip(1).position(|s| s.contains("@@")) {
205213
Some(idx + 1)
206-
} else if is_libafl_based {
214+
} else if is_libafl_based || tool.eq("casr-lua") {
207215
None
208216
} else {
209217
argv.push("@@");

casr/src/triage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a> CrashInfo {
5151
} else {
5252
args.push(format!("{}.casrep", report_path.display()));
5353
}
54-
if self.at_index.is_none() {
54+
if self.at_index.is_none() || self.at_index == Some(0) {
5555
args.push("--stdin".to_string());
5656
args.push(self.path.to_str().unwrap().to_string());
5757
}

0 commit comments

Comments
 (0)