diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-03-26 19:48:26 +0100 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-03-26 19:48:26 +0100 |
commit | 5a7d33330a2bbd4866138488b136dfd7bde3bf9b (patch) | |
tree | 8693ae2f34734310b529eb16cc8715038debf876 /examples/custom_mutators/example.c | |
parent | 12a9a1001e76cd5c6e26eee9e16cbdd4f54b9b7a (diff) | |
download | afl++-5a7d33330a2bbd4866138488b136dfd7bde3bf9b.tar.gz |
example fixed
Diffstat (limited to 'examples/custom_mutators/example.c')
-rw-r--r-- | examples/custom_mutators/example.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/custom_mutators/example.c b/examples/custom_mutators/example.c index 220d0ca1..8a45d87f 100644 --- a/examples/custom_mutators/example.c +++ b/examples/custom_mutators/example.c @@ -149,14 +149,15 @@ size_t afl_custom_pre_save(my_mutator_t *data, uint8_t *buf, size_t buf_size, data->pre_save_size = buf_size + 5; } - - memcpy(out_buf + 5, buf, buf_size); - out_buf_size = buf_size + 5; - out_buf[0] = 'A'; - out_buf[1] = 'F'; - out_buf[2] = 'L'; - out_buf[3] = '+'; - out_buf[4] = '+'; + *out_buf = data->pre_save_buf; + + memcpy(*out_buf + 5, buf, buf_size); + size_t out_buf_size = buf_size + 5; + *out_buf[0] = 'A'; + *out_buf[1] = 'F'; + *out_buf[2] = 'L'; + *out_buf[3] = '+'; + *out_buf[4] = '+'; return out_buf_size; |