diff options
-rw-r--r-- | cpputil/databuffer.h | 10 | ||||
-rw-r--r-- | gtests/ssl_gtest/tls_filter.cc | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/cpputil/databuffer.h b/cpputil/databuffer.h index d46944d4b..8d34e1a7d 100644 --- a/cpputil/databuffer.h +++ b/cpputil/databuffer.h @@ -32,7 +32,15 @@ class DataBuffer { } return *this; } - DataBuffer& operator=(DataBuffer&&) = default; + DataBuffer& operator=(DataBuffer&& other) { + if (this == &other) { + data_ = other.data_; + len_ = other.len_; + other.data_ = nullptr; + other.len_ = 0; + } + return *this; + } void Allocate(size_t l) { delete[] data_; diff --git a/gtests/ssl_gtest/tls_filter.cc b/gtests/ssl_gtest/tls_filter.cc index 29f112307..70f2d4ce1 100644 --- a/gtests/ssl_gtest/tls_filter.cc +++ b/gtests/ssl_gtest/tls_filter.cc @@ -1257,7 +1257,7 @@ PacketFilter::Action ClientHelloPreambleCapture::FilterHandshake( EXPECT_TRUE(parser.ReadVariable(&temp, 1)); // Compression // Copy the preamble into a new buffer - data_ = DataBuffer(input); + data_ = input; data_.Truncate(parser.consumed()); return KEEP; |