From 3a3126acaed4f4c41d0f37598c8beedd18b919d9 Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Tue, 4 Jan 2022 15:54:28 +0100 Subject: [PATCH] Add another fuzzing test, make build script run on Windows --- build.rs | 20 +++++++++++++------- in/sentry_recursion | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 in/sentry_recursion diff --git a/build.rs b/build.rs index 477f8d5..cb6a232 100644 --- a/build.rs +++ b/build.rs @@ -70,7 +70,13 @@ use std::io::Read; "no file name for AFL.rs seed test case", ) })?; - println!("cargo:rerun-if-changed=in/{}", Path::new(file_name).display()); + println!( + "cargo:rerun-if-changed=in/{}", + Path::new(file_name).display() + ); + + // properly escape windows paths + let path = path.to_string_lossy().replace("\\", "\\\\"); writeln!( &mut test_file, @@ -85,7 +91,7 @@ fn test_afl_seed_{}() {{ }} "#, file_name.to_string_lossy(), - path.to_string_lossy() + path )?; } @@ -190,7 +196,7 @@ use std::fmt::Write; Some(Err(e)) => return Err(e), }; - if options.find("--no-params").is_some() { + if options.contains("--no-params") { // This line is the expected demangled output without function and // template parameters, but we don't currently have such an option // in `cpp_demangle`, so just consume and ignore the line. @@ -207,10 +213,10 @@ use std::fmt::Write; } // Skip tests for unsupported languages or options. - if options.find("--format=gnu-v3").is_none() - || options.find("--is-v3-ctor").is_some() - || options.find("--is-v3-dtor").is_some() - || options.find("--ret-postfix").is_some() + if !options.contains("--format=gnu-v3") + || options.contains("--is-v3-ctor") + || options.contains("--is-v3-dtor") + || options.contains("--ret-postfix") { continue; } diff --git a/in/sentry_recursion b/in/sentry_recursion new file mode 100644 index 0000000..c154488 --- /dev/null +++ b/in/sentry_recursion @@ -0,0 +1 @@ +_ZUlzjjlZZL1zStUlSt7j_Z3kjIIjIjL1vfIIEEEjzjjfjzSt7j_Z3kjIIjfjzL4t3kjIIjfjtUlSt7j_Z3kjIIjIjL1vfIIEEEjzjjfjzSt7j_Z3kjIIjfjzL4t3kjIIjfjzL4t7IjIjjzjjzSt7j_Z3kjIIjfjzStfjzSt7j_ZA3kjIIjIjL1vfIIEEEjzjjfjzSt7j_Z3kjIIjIjL1vfIIEEEjzjjfjzSt7j_Z3kjIIjfjzL4t3kjIIjzL4t7IjIjjzjjzSt7j_Z3kjIIjfjzStfjzSt7j_ZA3kjIIjIjL1vfIIEEEjzjjfjzSt7j_Z3kjIIjIjL1vfIIEEEjzjjfjzSt7j_Z3kjIIjfjzL4t3kjIIjfjzL4t7IjIjL1vfIIEEEjzjjSI \ No newline at end of file