diff --git a/contrib/epee/src/byte_slice.cpp b/contrib/epee/src/byte_slice.cpp index 72aa397684..7a424383fc 100644 --- a/contrib/epee/src/byte_slice.cpp +++ b/contrib/epee/src/byte_slice.cpp @@ -162,7 +162,7 @@ namespace epee for (const auto& source : sources) { - std::memcpy(out.data(), source.data(), source.size()); + std::memcpy(out.data(), source.data(), std::min(out.size(), source.size())); if (out.remove_prefix(source.size()) < source.size()) throw std::bad_alloc{}; // size_t overflow on space_needed }