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

Function WriteEdgeToMutationGraphFile

fuzz/libfuzzer/FuzzerLoop.cpp:491–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491static void WriteEdgeToMutationGraphFile(const std::string &MutationGraphFile,
492 const InputInfo *II,
493 const InputInfo *BaseII,
494 const std::string &MS) {
495 if (MutationGraphFile.empty())
496 return;
497
498 std::string Sha1 = Sha1ToString(II->Sha1);
499
500 std::string OutputString;
501
502 // Add a new vertex.
503 OutputString.append("\"");
504 OutputString.append(Sha1);
505 OutputString.append("\"\n");
506
507 // Add a new edge if there is base input.
508 if (BaseII) {
509 std::string BaseSha1 = Sha1ToString(BaseII->Sha1);
510 OutputString.append("\"");
511 OutputString.append(BaseSha1);
512 OutputString.append("\" -> \"");
513 OutputString.append(Sha1);
514 OutputString.append("\" [label=\"");
515 OutputString.append(MS);
516 OutputString.append("\"];\n");
517 }
518
519 AppendToFile(OutputString, MutationGraphFile);
520}
521
522bool Fuzzer::RunOne(const uint8_t *Data, size_t Size, bool MayDeleteFile,
523 InputInfo *II, bool ForceAddToCorpus,

Callers 1

RunOneMethod · 0.85

Calls 3

AppendToFileFunction · 0.85
Sha1ToStringFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected