about summary refs log tree commit diff
path: root/src/afl-fuzz-mutators.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-04-12 10:54:08 +0200
committerGitHub <noreply@github.com>2023-04-12 10:54:08 +0200
commit4f2d9eeaaa6b702ef28eb883f9000321eaf1fe9b (patch)
tree125cecc79c148552844723e95ddd246bf918d6fc /src/afl-fuzz-mutators.c
parent7101192865893e00b9029d0cb898a3ca3015d50b (diff)
parent743ae507756db0707a213cd8272b219b0de0f514 (diff)
downloadafl++-4f2d9eeaaa6b702ef28eb883f9000321eaf1fe9b.tar.gz
Merge pull request #1700 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-mutators.c')
-rw-r--r--src/afl-fuzz-mutators.c16
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);