about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--docs/Changelog.md1
-rw-r--r--unicorn_mode/UNICORNAFL_VERSION2
-rw-r--r--unicorn_mode/samples/speedtest/rust/src/main.rs5
m---------unicorn_mode/unicornafl0
4 files changed, 5 insertions, 3 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 062dd785..12f81571 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -39,6 +39,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
       CLANG for old afl-clang
   - unicornafl
     - Substential speed gains in python bindings for certain use cases
+    - Improved rust bindings
     - Added a new example harness to compare python, c, and rust bindings
   - changed default: no memory limit for afl-cmin and afl-cmin.bash
   - warn on any _AFL and __AFL env vars
diff --git a/unicorn_mode/UNICORNAFL_VERSION b/unicorn_mode/UNICORNAFL_VERSION
index f1fb7f18..a02531ec 100644
--- a/unicorn_mode/UNICORNAFL_VERSION
+++ b/unicorn_mode/UNICORNAFL_VERSION
@@ -1 +1 @@
-0dd17c58
+2a54500c
diff --git a/unicorn_mode/samples/speedtest/rust/src/main.rs b/unicorn_mode/samples/speedtest/rust/src/main.rs
index 8e31d2e2..1e35ff0b 100644
--- a/unicorn_mode/samples/speedtest/rust/src/main.rs
+++ b/unicorn_mode/samples/speedtest/rust/src/main.rs
@@ -194,18 +194,19 @@ fn fuzz(input_file: &str) -> Result<(), uc_error> {
     }
 
     let place_input_callback =
-        |mut uc: UnicornHandle<'_, _>, afl_input: &[u8], _persistent_round| {
+        |mut uc: UnicornHandle<'_, _>, afl_input: &mut [u8], _persistent_round| {
             // apply constraints to the mutated input
             if afl_input.len() > INPUT_MAX as usize {
                 //println!("Skipping testcase with leng {}", afl_input.len());
                 return false;
             }
 
-            // TODO: afl_input[-1] = b'\0'
+            afl_input[afl_input.len() - 1] = b'\0';
             uc.mem_write(INPUT_ADDRESS, afl_input).unwrap();
             true
         };
 
+    // return true if the last run should be counted as crash
     let crash_validation_callback =
         |_uc: UnicornHandle<'_, _>, result, _input: &[u8], _persistent_round| {
             result != uc_error::OK
diff --git a/unicorn_mode/unicornafl b/unicorn_mode/unicornafl
-Subproject 0dd17c58d51ed6dc69a367adbe8d2dca4d224c4
+Subproject 2a54500c08758d29caacd1ccf47d034d9faa4a1