[libc-commits] [libc] [libc][bug] Fix out of bound write in memcpy w/ software prefetching (PR #90591)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Mon May 20 11:13:15 PDT 2024


================
@@ -0,0 +1,45 @@
+//===-- memset_fuzz.cpp ---------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// Fuzzing test for llvm-libc memcset implementation.
+///
+//===----------------------------------------------------------------------===//
+#include "protected_pages.h"
+#include "src/string/memset.h"
+#include <stddef.h> // size_t
+#include <stdint.h> // uint8_t
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t data_size) {
+  static constexpr size_t MAX_SIZE = 1024;
+  static ProtectedPages pages;
----------------
nickdesaulniers wrote:

Does it have something to do with the function name?

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


More information about the libc-commits mailing list