[compiler-rt] Work around a C language bug in libFuzzer (PR #96775)

David Benjamin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 09:29:28 PDT 2024


================
@@ -579,6 +579,9 @@ void Fuzzer::CrashOnOverwrittenData() {
 // Compare two arrays, but not all bytes if the arrays are large.
 static bool LooseMemeq(const uint8_t *A, const uint8_t *B, size_t Size) {
   const size_t Limit = 64;
+  // memcmp cannot be passed empty slices when the pointers are null.
+  if (!Size)
+    return 1;
----------------
davidben wrote:

Fixed.

https://github.com/llvm/llvm-project/pull/96775


More information about the llvm-commits mailing list