diff options
author | van Hauser <vh@thc.org> | 2020-08-20 11:00:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 11:00:07 +0200 |
commit | 572944d7267e3612ef8da17a180bc3d8f1a958a7 (patch) | |
tree | d2110370094b94f1ed0b2ece83ed32fb8de86b15 /src/afl-fuzz-run.c | |
parent | 17d403b8f873bcadf3fc507f9b49fe4bc0dda162 (diff) | |
parent | 779d8f6b7e3454fcfd7a43c4cf54d72ea025e67d (diff) | |
download | afl++-572944d7267e3612ef8da17a180bc3d8f1a958a7.tar.gz |
Merge pull request #514 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-run.c')
-rw-r--r-- | src/afl-fuzz-run.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c index d3f823c9..d71ec339 100644 --- a/src/afl-fuzz-run.c +++ b/src/afl-fuzz-run.c @@ -135,8 +135,6 @@ write_to_testcase(afl_state_t *afl, void *mem, u32 len) { } -#define BUF_PARAMS(name) (void **)&afl->name##_buf, &afl->name##_size - /* The same, but with an adjustable gap. Used for trimming. */ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at, @@ -149,7 +147,8 @@ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at, This memory is used to carry out the post_processing(if present) after copying the testcase by removing the gaps. This can break though */ - u8 *mem_trimmed = ck_maybe_grow(BUF_PARAMS(out_scratch), len - skip_len + 1); + u8 *mem_trimmed = afl_realloc(AFL_BUF_PARAM(out_scratch), len - skip_len + 1); + if (unlikely(!mem_trimmed)) { PFATAL("alloc"); } ssize_t new_size = len - skip_len; void * new_mem = mem; @@ -288,8 +287,6 @@ static void write_with_gap(afl_state_t *afl, u8 *mem, u32 len, u32 skip_at, } -#undef BUF_PARAMS - /* Calibrate a new test case. This is done when processing the input directory to warn about flaky or otherwise problematic test cases early on; and when new paths are discovered to detect variable behavior and so on. */ |