File: 11-callback-rv.patch

package info (click to toggle)
firefox 147.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,484 kB
  • sloc: cpp: 7,607,246; javascript: 6,533,185; ansic: 3,775,227; python: 1,415,393; xml: 634,561; asm: 438,951; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (33 lines) | stat: -rw-r--r-- 1,328 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
commit 32a07682ac69aa3ef2a2e119335b9a7d4d9e2cd0
Author: Christian Holler <choller@mozilla.com>
Date:   Thu Jul 30 18:27:28 2020 +0200

    [libFuzzer] Change libFuzzer callback contract to allow positive return values

diff --git a/FuzzerLoop.cpp b/FuzzerLoop.cpp
index a93cd16b8793..4339cf2e0dbb 100644
--- a/FuzzerLoop.cpp
+++ b/FuzzerLoop.cpp
@@ -619,7 +619,6 @@ ATTRIBUTE_NOINLINE bool Fuzzer::ExecuteCallback(const uint8_t *Data,
     CBRes = CB(DataCopy, Size);
     RunningUserCallback = false;
     UnitStopTime = system_clock::now();
-    assert(CBRes == 0 || CBRes == -1);
     HasMoreMallocsThanFrees = AllocTracer.Stop();
   }
   if (!LooseMemeq(DataCopy, Data, Size))
diff --git a/FuzzerMerge.cpp b/FuzzerMerge.cpp
index 8c8806e8aafd..69e71135a3e4 100644
--- a/FuzzerMerge.cpp
+++ b/FuzzerMerge.cpp
@@ -236,7 +236,9 @@ void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath,
     OF.flush();  // Flush is important since Command::Execute may crash.
     // Run.
     TPC.ResetMaps();
-    ExecuteCallback(U.data(), U.size());
+    if (!ExecuteCallback(U.data(), U.size())) {
+      continue;
+    }
     // Collect coverage. We are iterating over the files in this order:
     // * First, files in the initial corpus ordered by size, smallest first.
     // * Then, all other files, smallest first.