aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-03-07 14:26:33 +0100
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-03-07 14:26:33 +0100
commited5d65b54f07570c82f6704fdca403b776ff7be2 (patch)
treec94bdcd834b4d011df9e2f0fa4e7cd0fd8689019
parent172d384bf26b57beecbe084d19530ebc34a6e3fc (diff)
downloadafl++-ed5d65b54f07570c82f6704fdca403b776ff7be2.tar.gz
solve linking error when python is not available
-rw-r--r--include/afl-fuzz.h2
-rw-r--r--src/afl-fuzz-mutators.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 1db44a79..57639411 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -647,8 +647,6 @@ extern PyObject* py_functions[PY_FUNC_COUNT];
/* Custom mutators */
void setup_custom_mutator(void);
void destroy_custom_mutator(void);
-void load_custom_mutator(const char*);
-void load_custom_mutator_py(const char*);
u8 trim_case_custom(char** argv, struct queue_entry* q, u8* in_buf);
/* Python */
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c
index 5bf257fb..76ce2c96 100644
--- a/src/afl-fuzz-mutators.c
+++ b/src/afl-fuzz-mutators.c
@@ -25,6 +25,11 @@
#include "afl-fuzz.h"
+void load_custom_mutator(const char*);
+#ifdef USE_PYTHON
+void load_custom_mutator_py(const char*);
+#endif
+
void setup_custom_mutator(void) {
/* Try mutator library first */
@@ -286,6 +291,7 @@ abort_trimming:
}
+#ifdef USE_PYTHON
void load_custom_mutator_py(const char* module_name) {
mutator = ck_alloc(sizeof(struct custom_mutator));
@@ -325,3 +331,4 @@ void load_custom_mutator_py(const char* module_name) {
mutator->afl_custom_init(UR(0xFFFFFFFF));
}
+#endif