Fix memcpy in byte_slice constructor
This commit is contained in:
parent
893916ad09
commit
d54f04d50c
|
@ -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