aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-08-11 03:40:12 +0200
committerGitHub <noreply@github.com>2020-08-11 03:40:12 +0200
commit67dac152269c48245dca88140b1238b36d5e0954 (patch)
tree81e8f262c1dc403e34c7b287ba68c81bb37cb4d0 /src
parent9cf8637fab8cf3fe8aba5660015bbe7177805807 (diff)
parent50e76fce123f01ec83024f3bbd3190f2e1a6d387 (diff)
downloadafl++-67dac152269c48245dca88140b1238b36d5e0954.tar.gz
Merge branch 'debug' into taint
Diffstat (limited to 'src')
-rw-r--r--src/afl-forkserver.c13
-rw-r--r--src/afl-fuzz-cmplog.c4
-rw-r--r--src/afl-fuzz-mutators.c1
-rw-r--r--src/afl-fuzz-one.c2
-rw-r--r--src/afl-fuzz-run.c2
-rw-r--r--src/afl-fuzz.c5
6 files changed, 14 insertions, 13 deletions
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index 4dc5e438..adb75a2d 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -293,8 +293,8 @@ static void report_error_and_exit(int error) {
FATAL(
"the fuzzing target reports that hardcoded map address might be the "
"reason the mmap of the shared memory failed. Solution: recompile "
- "the target with either afl-clang-lto and the environment variable "
- "AFL_LLVM_MAP_DYNAMIC set or recompile with afl-clang-fast.");
+ "the target with either afl-clang-lto and do not set "
+ "AFL_LLVM_MAP_ADDR or recompile with afl-clang-fast.");
break;
case FS_ERROR_SHM_OPEN:
FATAL("the fuzzing target reports that the shm_open() call failed.");
@@ -838,8 +838,8 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
SAYF("\n" cLRD "[-] " cRST
"Hmm, looks like the target binary terminated before we could"
" complete a handshake with the injected code.\n"
- "If the target was compiled with afl-clang-lto then recompiling with"
- " AFL_LLVM_MAP_DYNAMIC might solve your problem.\n"
+ "If the target was compiled with afl-clang-lto and AFL_LLVM_MAP_ADDR"
+ " then recompiling without this parameter.\n"
"Otherwise there is a horrible bug in the fuzzer.\n"
"Poke <afl-users@googlegroups.com> for troubleshooting tips.\n");
@@ -870,9 +870,8 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
" - the target was compiled with afl-clang-lto and a constructor "
"was\n"
- " instrumented, recompiling with AFL_LLVM_MAP_DYNAMIC might solve "
- "your\n"
- " problem\n\n"
+ " instrumented, recompiling without AFL_LLVM_MAP_ADDR might solve "
+ "your problem\n\n"
" - Less likely, there is a horrible bug in the fuzzer. If other "
"options\n"
diff --git a/src/afl-fuzz-cmplog.c b/src/afl-fuzz-cmplog.c
index faf4dcb7..8ffc6e1b 100644
--- a/src/afl-fuzz-cmplog.c
+++ b/src/afl-fuzz-cmplog.c
@@ -29,10 +29,6 @@
#include "afl-fuzz.h"
#include "cmplog.h"
-typedef struct cmplog_data {
-
-} cmplog_data_t;
-
void cmplog_exec_child(afl_forkserver_t *fsrv, char **argv) {
setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c
index b30106a0..0fa646f9 100644
--- a/src/afl-fuzz-mutators.c
+++ b/src/afl-fuzz-mutators.c
@@ -142,6 +142,7 @@ struct custom_mutator *load_custom_mutator(afl_state_t *afl, const char *fn) {
struct custom_mutator *mutator = ck_alloc(sizeof(struct custom_mutator));
mutator->name = fn;
+ mutator->name_short = strrchr(fn, '/') + 1;
ACTF("Loading custom mutator library from '%s'...", fn);
dh = dlopen(fn, RTLD_NOW);
diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c
index 75687703..9f38b8f8 100644
--- a/src/afl-fuzz-one.c
+++ b/src/afl-fuzz-one.c
@@ -1764,6 +1764,8 @@ custom_mutator_stage:
has_custom_fuzz = true;
+ afl->stage_short = el->name_short;
+
for (afl->stage_cur = 0; afl->stage_cur < afl->stage_max;
++afl->stage_cur) {
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index 0aef1c9e..9db23134 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -138,7 +138,7 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) {
/* The same, but with an adjustable gap. Used for trimming. */
-static void write_with_gap(afl_state_t *afl, void *mem, u32 len, u32 skip_at,
+static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at,
u32 skip_len) {
s32 fd = afl->fsrv.out_fd;
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index fc9cbb6c..11db004d 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -300,9 +300,12 @@ int main(int argc, char **argv_orig, char **envp) {
if (afl->cpu_to_bind != -1) FATAL("Multiple -b options not supported");
- if (sscanf(optarg, "%u", &afl->cpu_to_bind) < 0 || optarg[0] == '-')
+ if (sscanf(optarg, "%d", &afl->cpu_to_bind) < 0) {
+
FATAL("Bad syntax used for -b");
+ }
+
break;
}