diff options
author | van Hauser <vh@thc.org> | 2023-06-06 17:36:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 17:36:04 +0300 |
commit | 4deb45f3b3e9f53880596d21432069b05553bcb3 (patch) | |
tree | 2dcf56dd0b540a4387f050c32ba5f50e7f42d666 /src/afl-fuzz-mutators.c | |
parent | 8de7f6131d48e27d53e894b65bd11e0dc3817639 (diff) | |
parent | 2f6b54e4410738d92c4981a700541f15e4fbe938 (diff) | |
download | afl++-4deb45f3b3e9f53880596d21432069b05553bcb3.tar.gz |
Merge pull request #1759 from AFLplusplus/dev
Dev
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r-- | src/afl-fuzz-mutators.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/afl-fuzz-mutators.c b/src/afl-fuzz-mutators.c index 9ea46e7a..64dbe7c6 100644 --- a/src/afl-fuzz-mutators.c +++ b/src/afl-fuzz-mutators.c @@ -179,11 +179,19 @@ struct custom_mutator *load_custom_mutator(afl_state_t *afl, const char *fn) { void *dh; struct custom_mutator *mutator = ck_alloc(sizeof(struct custom_mutator)); - mutator->name = fn; - if (memchr(fn, '/', strlen(fn))) - mutator->name_short = strrchr(fn, '/') + 1; - else + if (memchr(fn, '/', strlen(fn))) { + + mutator->name_short = strdup(strrchr(fn, '/') + 1); + + } else { + mutator->name_short = strdup(fn); + + } + + if (strlen(mutator->name_short) > 22) { mutator->name_short[21] = 0; } + + mutator->name = fn; ACTF("Loading custom mutator library from '%s'...", fn); dh = dlopen(fn, RTLD_NOW); |