Fix memcpy in byte_slice constructor

This commit is contained in:
Lee *!* Clagett 2024-11-19 18:51:52 -05:00
parent 58a1d54a4f
commit 36c7315f59
1 changed files with 1 additions and 1 deletions

View File

@ -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
}