Fix memcpy in byte_slice constructor
This commit is contained in:
parent
58a1d54a4f
commit
36c7315f59
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue