# HG changeset patch # User Yuya Nishihara # Date 2018-06-03 04:12:32 # Node ID a1c0873a9990bbf93e397c602d737f2ae32d9315 # Parent 4dd3b6c68f9657a3b942628e9ce48388a0b1c03b fuzz: fix use of undeclared function memcpy() diff --git a/contrib/fuzz/fuzzutil.cc b/contrib/fuzz/fuzzutil.cc --- a/contrib/fuzz/fuzzutil.cc +++ b/contrib/fuzz/fuzzutil.cc @@ -1,5 +1,6 @@ #include "fuzzutil.h" +#include #include contrib::optional SplitInputs(const uint8_t *Data, size_t Size) @@ -13,11 +14,11 @@ contrib::optional SplitInput // Copy inputs to new allocations so if bdiff over-reads // AddressSanitizer can detect it. std::unique_ptr left(new char[left_size]); - memcpy(left.get(), Data + 1, left_size); + std::memcpy(left.get(), Data + 1, left_size); // right starts at the next byte after left ends size_t right_size = Size - (left_size + 1); std::unique_ptr right(new char[right_size]); - memcpy(right.get(), Data + 1 + left_size, right_size); + std::memcpy(right.get(), Data + 1 + left_size, right_size); LOG(2) << "inputs are " << left_size << " and " << right_size << " bytes" << std::endl; two_inputs result = {std::move(right), right_size, std::move(left),