MCPcopy Create free account
hub / github.com/HexHive/NASS / Fuzzer

Method Fuzzer

fuzz/libfuzzer/FuzzerLoop.cpp:141–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD,
142 const FuzzingOptions &Options)
143 : CB(CB), Corpus(Corpus), MD(MD), Options(Options) {
144 if (EF->__sanitizer_set_death_callback)
145 EF->__sanitizer_set_death_callback(StaticDeathCallback);
146 if (EF->__sanitizer_set_crash_callback)
147 EF->__sanitizer_set_crash_callback(StaticCrashSignalCallback);
148 if (EF->LLVMFuzzerPassStats)
149 EF->LLVMFuzzerPassStats(&TotalNumberOfRuns, &NumberOfNewUnitsAdded, &LastCorpusUpdateRun);
150 assert(!F);
151 F = this;
152 TPC.ResetMaps();
153 IsMyThread = true;
154 if (Options.DetectLeaks && EF->__sanitizer_install_malloc_and_free_hooks)
155 EF->__sanitizer_install_malloc_and_free_hooks(MallocHook, FreeHook);
156 TPC.SetUseCounters(Options.UseCounters);
157 TPC.SetUseValueProfileMask(Options.UseValueProfile);
158
159 if (Options.Verbosity)
160 TPC.PrintModuleInfo();
161 if (!Options.OutputCorpus.empty() && Options.ReloadIntervalSec)
162 EpochOfLastReadOfOutputCorpus = GetEpoch(Options.OutputCorpus);
163 MaxInputLen = MaxMutationLen = Options.MaxLen;
164 TmpMaxMutationLen = 0; // Will be set once we load the corpus.
165 AllocateCurrentUnitData();
166 CurrentUnitSize = 0;
167 memset(BaseSha1, 0, sizeof(BaseSha1));
168}
169
170void Fuzzer::AllocateCurrentUnitData() {
171 if (CurrentUnitData || MaxInputLen == 0)

Callers

nothing calls this directly

Calls 6

GetEpochFunction · 0.85
ResetMapsMethod · 0.80
SetUseCountersMethod · 0.80
PrintModuleInfoMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected