0
0
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:
James Yonan 2018-02-16 15:07:45 -07:00 committed by Antonio Quartulli
parent 33c16812e1
commit 94526ac195
No known key found for this signature in database
GPG Key ID: 07A53C580EF2CD74

View File

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