From: Jérémie Astor Date: Sun, 17 May 2020 12:31:24 +0000 (+0200) Subject: :wrench: Fuzzit X-Git-Tag: nightly~1543 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=0d3d65ba2818239c269f47b95ee8d4c1da75bc9c;p=gwion.git :wrench: Fuzzit --- diff --git a/scripts/fuzzer.c b/scripts/fuzzer.c index ee1b02ef..3f207681 100644 --- a/scripts/fuzzer.c +++ b/scripts/fuzzer.c @@ -21,10 +21,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { push_global(&gwion, "[afl]"); m_str str = mp_calloc2(gwion.mp, Size + 1); memcpy(str, Data, Size); - str[Size] = '\0'; if(compile_string(&gwion, "libfuzzer", str)) gwion_run(&gwion); - pop_global(&gwion); mp_free2(gwion.mp, Size + 1, str); + pop_global(&gwion); return 0; } diff --git a/src/gwion.c b/src/gwion.c index d1f0e336..df4abb90 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -151,8 +151,8 @@ ANN static void env_header(const Env env) { ANN void env_err(const Env env, const loc_t pos, const m_str fmt, ...) { if(env->context && env->context->error) - return; -#ifndef __AFL_HAVE_MANUAL_CONTROL + return; +#ifndef __FUZZING__ env_header(env); loc_header(pos, env->name); va_list arg;