diff options
author | vanhauser-thc <vh@thc.org> | 2023-04-08 13:48:07 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2023-04-08 13:48:07 +0200 |
commit | 75d7a094691550afe86519a1d669def0d698b5ce (patch) | |
tree | 617d8bc7fba2e878f74befa7a54e5111245ef80b /src/afl-fuzz-mutators.c | |
parent | f9851dbfbbfbc013172f500099b5f4dc572c508b (diff) | |
download | afl++-75d7a094691550afe86519a1d669def0d698b5ce.tar.gz |
show custom mutator name in UI
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); |