diff options
| author | van Hauser <vh@thc.org> | 2020-11-18 21:25:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-18 21:25:35 +0100 |
| commit | 4d9eb9bda147a26fc8cbe885b6193cf0c94c6314 (patch) | |
| tree | c7a903633c7d1b0b5e373535188fd3a458a7f329 /examples/custom_mutators | |
| parent | 4c59c5234aec0469e4dd02561dbd84387bd53155 (diff) | |
| parent | cd0a25be5e9b05a2ab6a11592cd95e7f653bf42d (diff) | |
| download | afl++-4d9eb9bda147a26fc8cbe885b6193cf0c94c6314.tar.gz | |
Merge pull request #607 from AFLplusplus/dev
push to stable
Diffstat (limited to 'examples/custom_mutators')
| -rw-r--r-- | examples/custom_mutators/custom_mutator_helpers.h | 2 | ||||
| -rw-r--r-- | examples/custom_mutators/post_library_gif.so.c | 8 | ||||
| -rw-r--r-- | examples/custom_mutators/post_library_png.so.c | 8 | ||||
| -rw-r--r-- | examples/custom_mutators/simple_example.c | 2 |
4 files changed, 16 insertions, 4 deletions
diff --git a/examples/custom_mutators/custom_mutator_helpers.h b/examples/custom_mutators/custom_mutator_helpers.h index ad5acb08..62e6efba 100644 --- a/examples/custom_mutators/custom_mutator_helpers.h +++ b/examples/custom_mutators/custom_mutator_helpers.h @@ -13,7 +13,7 @@ #define BUF_VAR(type, name) \ type * name##_buf; \ size_t name##_size; -/* this filles in `&structptr->something_buf, &structptr->something_size`. */ +/* this fills in `&structptr->something_buf, &structptr->something_size`. */ #define BUF_PARAMS(struct, name) \ (void **)&struct->name##_buf, &struct->name##_size diff --git a/examples/custom_mutators/post_library_gif.so.c b/examples/custom_mutators/post_library_gif.so.c index 2d72400c..ac10f409 100644 --- a/examples/custom_mutators/post_library_gif.so.c +++ b/examples/custom_mutators/post_library_gif.so.c @@ -94,7 +94,13 @@ void *afl_custom_init(void *afl) { } state->buf = calloc(sizeof(unsigned char), 4096); - if (!state->buf) { return NULL; } + if (!state->buf) { + + free(state); + perror("calloc"); + return NULL; + + } return state; diff --git a/examples/custom_mutators/post_library_png.so.c b/examples/custom_mutators/post_library_png.so.c index 7c1ea93e..941f7e55 100644 --- a/examples/custom_mutators/post_library_png.so.c +++ b/examples/custom_mutators/post_library_png.so.c @@ -54,7 +54,13 @@ void *afl_custom_init(void *afl) { } state->buf = calloc(sizeof(unsigned char), 4096); - if (!state->buf) { return NULL; } + if (!state->buf) { + + free(state); + perror("calloc"); + return NULL; + + } return state; diff --git a/examples/custom_mutators/simple_example.c b/examples/custom_mutators/simple_example.c index a351d787..d888ec1f 100644 --- a/examples/custom_mutators/simple_example.c +++ b/examples/custom_mutators/simple_example.c @@ -8,7 +8,7 @@ #include <stdio.h> #ifndef _FIXED_CHAR - #define 0x41 + #define _FIXED_CHAR 0x41 #endif typedef struct my_mutator { |
