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

Function ParseSeedInuts

fuzz/libfuzzer/FuzzerDriver.cpp:612–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612std::vector<std::string> ParseSeedInuts(const char *seed_inputs) {
613 // Parse -seed_inputs=file1,file2,... or -seed_inputs=@seed_inputs_file
614 std::vector<std::string> Files;
615 if (!seed_inputs) return Files;
616 std::string SeedInputs;
617 if (Flags.seed_inputs[0] == '@')
618 SeedInputs = FileToString(Flags.seed_inputs + 1); // File contains list.
619 else
620 SeedInputs = Flags.seed_inputs; // seed_inputs contains the list.
621 if (SeedInputs.empty()) {
622 Printf("seed_inputs is empty or @file does not exist.\n");
623 exit(1);
624 }
625 // Parse SeedInputs.
626 size_t comma_pos = 0;
627 while ((comma_pos = SeedInputs.find_last_of(',')) != std::string::npos) {
628 Files.push_back(SeedInputs.substr(comma_pos + 1));
629 SeedInputs = SeedInputs.substr(0, comma_pos);
630 }
631 Files.push_back(SeedInputs);
632 return Files;
633}
634
635static std::vector<SizedFile>
636ReadCorpora(const std::vector<std::string> &CorpusDirs,

Callers 1

FuzzerDriverFunction · 0.85

Calls 4

FileToStringFunction · 0.85
PrintfFunction · 0.70
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected