Skip to content

Commit be730d8

Browse files
committed
Prevent assining over initialized FmqSsl
We raise an abort when that happens, because it's undefined behavior in our case, and should not happen.
1 parent 54d5022 commit be730d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fmqssl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <openssl/ssl.h>
44

55
#include "fmqssl.h"
6+
#include "utils.h"
67

78
FmqSsl::~FmqSsl()
89
{
@@ -34,6 +35,8 @@ FmqSsl::FmqSsl(FmqSsl &&other) :
3435

3536
FmqSsl &FmqSsl::operator=(FmqSsl &&other)
3637
{
38+
FMQ_ENSURE(this->d == nullptr)
39+
3740
d = other.d;
3841
other.d = nullptr;
3942
return *this;

0 commit comments

Comments
 (0)