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

Method RereadOutputCorpus

fuzz/libfuzzer/FuzzerLoop.cpp:429–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429void Fuzzer::RereadOutputCorpus(size_t MaxSize) {
430 if (Options.OutputCorpus.empty() || !Options.ReloadIntervalSec)
431 return;
432 std::vector<Unit> AdditionalCorpus;
433 std::vector<std::string> AdditionalCorpusPaths;
434 ReadDirToVectorOfUnits(
435 Options.OutputCorpus.c_str(), &AdditionalCorpus,
436 &EpochOfLastReadOfOutputCorpus, MaxSize,
437 /*ExitOnError*/ false,
438 (Options.Verbosity >= 2 ? &AdditionalCorpusPaths : nullptr));
439 if (Options.Verbosity >= 2)
440 Printf("Reload: read %zd new units.\n", AdditionalCorpus.size());
441 bool Reloaded = false;
442 for (size_t i = 0; i != AdditionalCorpus.size(); ++i) {
443 auto &U = AdditionalCorpus[i];
444 if (U.size() > MaxSize)
445 U.resize(MaxSize);
446 if (!Corpus.HasUnit(U)) {
447 if (RunOne(U.data(), U.size())) {
448 CheckExitOnSrcPosOrItem();
449 Reloaded = true;
450 if (Options.Verbosity >= 2)
451 Printf("Reloaded %s\n", AdditionalCorpusPaths[i].c_str());
452 }
453 }
454 }
455 if (Reloaded)
456 PrintStats("RELOAD");
457}
458
459void Fuzzer::PrintPulseAndReportSlowInput(const uint8_t *Data, size_t Size) {
460 auto TimeOfUnit =

Callers

nothing calls this directly

Calls 8

ReadDirToVectorOfUnitsFunction · 0.85
HasUnitMethod · 0.80
PrintfFunction · 0.70
emptyMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected