mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
Use correct cast for downcasting reference.
For downcasting, static_cast<> is the appropriate cast. Using reinterpret_cast<> will NOT correctly adjust the `this` pointer and dereferencing such a value is undefined by spec. See [expr.reinterpret.cast]p7 for the relevant passage. The only legal use of this pointer is in another set of reinterpret_cast expressions that either land it into a numeric value, or back to the original type.
This commit is contained in:
committed by
Ivan Grokhotkov
parent
7b32e6ad37
commit
c6c54e710f
@ -63,7 +63,7 @@ public:
|
||||
|
||||
bool verify(WiFiClient& client, const char* host) override
|
||||
{
|
||||
auto wcs = reinterpret_cast<WiFiClientSecure&>(client);
|
||||
auto wcs = static_cast<WiFiClientSecure&>(client);
|
||||
return wcs.verify(_fingerprint.c_str(), host);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user