diff options
author | George Hazan <ghazan@miranda.im> | 2020-07-13 21:17:50 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-07-13 21:17:50 +0300 |
commit | dd925ffda8f7c62cc18d2dcf852f8fccd4c04836 (patch) | |
tree | e9488d19a1437261e110a1948fc1cd3787b2241c | |
parent | e2317d13f1c3011d7ae29d3913645235eb301703 (diff) |
fixes crash of NetlibSslUnique under Windows7
-rw-r--r-- | src/core/stdssl/src/netlibssl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp index 5a61752fd6..8781e4ea20 100644 --- a/src/core/stdssl/src/netlibssl.cpp +++ b/src/core/stdssl/src/netlibssl.cpp @@ -763,6 +763,13 @@ static void* NetlibSslUnique(SslHandle *ssl, int *cbLen) return nullptr;
LPBYTE pBuf = LPBYTE(bindings.dwInitiatorOffset);
+ if (bindings.dwInitiatorOffset == 0) {
+ char tmp[sizeof(bindings)*2 + 1];
+ bin2hex(&bindings, sizeof(bindings), tmp);
+ Netlib_Logf(nullptr, "Failed bindings: %s", tmp);
+ return nullptr;
+ }
+
bindings = *(SEC_CHANNEL_BINDINGS *)bindings.dwInitiatorOffset;
pBuf += bindings.dwApplicationDataOffset;
if (memcmp(pBuf, "tls-unique:", 11))
|