about summary refs log tree commit diff
path: root/custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2021-01-04 15:17:39 +0100
committerhexcoder- <heiko@hexco.de>2021-01-04 15:17:39 +0100
commit5cdbfeef4a84b9dc2e5f8e88ee018c6c6e72fa44 (patch)
treea31794b40b9b0400aaa15c994f5f77f86fe7123f /custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp
parent33a7d6f1688856c050b0ac71ac1df4018e4d531c (diff)
downloadafl++-5cdbfeef4a84b9dc2e5f8e88ee018c6c6e72fa44.tar.gz
Revert "code cleanups (from cppcheck)"
This reverts commit 33a7d6f1688856c050b0ac71ac1df4018e4d531c.
Diffstat (limited to 'custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp')
-rw-r--r--custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp b/custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp
index 489665f7..797a52a7 100644
--- a/custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp
+++ b/custom_mutators/libfuzzer/FuzzerDataFlowTrace.cpp
@@ -246,7 +246,7 @@ bool DataFlowTrace::Init(const std::string &DirPath, std::string *FocusFunction,
 
   }
 
-  if (FocusFuncIdx == SIZE_MAX || Files.size() <= 1)
+  if (!NumFunctions || FocusFuncIdx == SIZE_MAX || Files.size() <= 1)
     return false;
 
   // Read traces.
@@ -259,8 +259,8 @@ bool DataFlowTrace::Init(const std::string &DirPath, std::string *FocusFunction,
     if (!CorporaHashes.count(Name)) continue;  // not in the corpus.
     NumTraceFiles++;
     // Printf("=== %s\n", Name.c_str());
-    std::ifstream IF2(SF.File);
-    while (std::getline(IF2, L, '\n')) {
+    std::ifstream IF(SF.File);
+    while (std::getline(IF, L, '\n')) {
 
       size_t      FunctionNum = 0;
       std::string DFTString;
@@ -314,8 +314,8 @@ int CollectDataFlow(const std::string &DFTBinary, const std::string &DirPath,
     // we then request tags in [0,Size/2) and [Size/2, Size), and so on.
     // Function number => DFT.
     auto OutPath = DirPlusFile(DirPath, Hash(FileToVector(F.File)));
-//    std::unordered_map<size_t, Vector<uint8_t>> DFTMap;
-//    std::unordered_set<std::string>             Cov;
+    std::unordered_map<size_t, Vector<uint8_t>> DFTMap;
+    std::unordered_set<std::string>             Cov;
     Command                                     Cmd;
     Cmd.addArgument(DFTBinary);
     Cmd.addArgument(F.File);