mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
BufferAllocated: fixed regression in buffer copy
Fixed regression in: template <typename T_> BufferAllocatedType(const BufferType<T_>& other, const unsigned int flags) That was introduced by commit b48a1682a7e9c666e1b6605747d3d561f2fbb5c4 BufferAllocated: improve movability Added BufferAllocated move constructor for foreign BufferAllocated template classes. Basically the source of the memcpy was not taking into account the offset. Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
33c16812e1
commit
94526ac195
@ -655,7 +655,7 @@ namespace openvpn {
|
|||||||
{
|
{
|
||||||
data_ = new T[capacity_];
|
data_ = new T[capacity_];
|
||||||
if (size_)
|
if (size_)
|
||||||
std::memcpy(data_ + offset_, other.data_, size_ * sizeof(T));
|
std::memcpy(data_ + offset_, other.data_ + offset_, size_ * sizeof(T));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user