Skip to content

Commit 27827c8

Browse files
authored
Delete operator=(Self&) when copy constructor is deleted (#8535)
1 parent 684156d commit 27827c8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libraries/ESP8266WiFi/src/BearSSLHelpers.h

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class PublicKey {
5858

5959
// Disable the copy constructor, we're pointer based
6060
PublicKey(const PublicKey& that) = delete;
61+
PublicKey& operator=(const PublicKey& that) = delete;
6162

6263
private:
6364
brssl::public_key *_key;
@@ -86,6 +87,7 @@ class PrivateKey {
8687

8788
// Disable the copy constructor, we're pointer based
8889
PrivateKey(const PrivateKey& that) = delete;
90+
PrivateKey& operator=(const PrivateKey& that) = delete;
8991

9092
private:
9193
brssl::private_key *_key;
@@ -122,6 +124,7 @@ class X509List {
122124

123125
// Disable the copy constructor, we're pointer based
124126
X509List(const X509List& that) = delete;
127+
X509List& operator=(const X509List& that) = delete;
125128

126129
private:
127130
size_t _count;

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace BearSSL {
3434
class WiFiClientSecureCtx : public WiFiClient {
3535
public:
3636
WiFiClientSecureCtx();
37-
WiFiClientSecureCtx(const WiFiClientSecure &rhs) = delete;
37+
WiFiClientSecureCtx(const WiFiClientSecureCtx &rhs) = delete;
3838
~WiFiClientSecureCtx() override;
3939

4040
WiFiClientSecureCtx& operator=(const WiFiClientSecureCtx&) = delete;
@@ -43,7 +43,7 @@ class WiFiClientSecureCtx : public WiFiClient {
4343
// TODO: don't remove just yet to avoid including the WiFiClient default implementation and unintentionally causing
4444
// a 'slice' that this method tries to avoid in the first place
4545
std::unique_ptr<WiFiClient> clone() const override {
46-
return std::unique_ptr<WiFiClient>(new WiFiClientSecureCtx(*this));
46+
return nullptr;
4747
}
4848

4949
int connect(IPAddress ip, uint16_t port) override;

0 commit comments

Comments
 (0)