about summary refs log tree commit diff
path: root/custom_mutators/libfuzzer/libfuzzer.inc
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-10-06 13:18:32 +0200
committerGitHub <noreply@github.com>2021-10-06 13:18:32 +0200
commit02c9ae91aae13f296b87033abaaec8fdb27c4ad4 (patch)
treeff43639bafda87a4fc73e66e882b8c75f86497f8 /custom_mutators/libfuzzer/libfuzzer.inc
parent46683d651656f1876f6d4aeb24807ed71fa91237 (diff)
parentb9f88ab166bd798d25d3acdbc6b5c305d7875482 (diff)
downloadafl++-02c9ae91aae13f296b87033abaaec8fdb27c4ad4.tar.gz
Merge pull request #1098 from DanielEbert/fix-stack-use-after-return-in-libfuzzer-custom-mutator
fix stack-use-after-return in libfuzzer custom mutator
Diffstat (limited to 'custom_mutators/libfuzzer/libfuzzer.inc')
-rw-r--r--custom_mutators/libfuzzer/libfuzzer.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/custom_mutators/libfuzzer/libfuzzer.inc b/custom_mutators/libfuzzer/libfuzzer.inc
index 01f21dbe..8c4bdbf6 100644
--- a/custom_mutators/libfuzzer/libfuzzer.inc
+++ b/custom_mutators/libfuzzer/libfuzzer.inc
@@ -2,7 +2,7 @@
 
 extern "C" ATTRIBUTE_INTERFACE void
 LLVMFuzzerMyInit(int (*Callback)(const uint8_t *Data, size_t Size), unsigned int Seed) {
-  Random Rand(Seed);
+  auto *Rand = new Random(Seed);
   FuzzingOptions Options;
   Options.Verbosity = 3;
   Options.MaxLen = 1024000;
@@ -30,7 +30,7 @@ LLVMFuzzerMyInit(int (*Callback)(const uint8_t *Data, size_t Size), unsigned int
   struct EntropicOptions Entropic;
   Entropic.Enabled = Options.Entropic;
   EF = new ExternalFunctions();
-  auto *MD = new MutationDispatcher(Rand, Options);
+  auto *MD = new MutationDispatcher(*Rand, Options);
   auto *Corpus = new InputCorpus(Options.OutputCorpus, Entropic);
   auto *F = new Fuzzer(Callback, *Corpus, *MD, Options);
 }