mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
openssl: fix improper use of negative value
This commit is contained in:
parent
4ff9b4f96e
commit
b6e215ee7f
1 changed files with 7 additions and 1 deletions
|
@ -368,6 +368,7 @@ lws_ssl_info_callback(const SSL *ssl, int where, int ret)
|
|||
struct lws *wsi;
|
||||
struct lws_context *context;
|
||||
struct lws_ssl_info si;
|
||||
int fd;
|
||||
|
||||
#ifndef USE_WOLFSSL
|
||||
context = (struct lws_context *)SSL_CTX_get_ex_data(
|
||||
|
@ -380,7 +381,12 @@ lws_ssl_info_callback(const SSL *ssl, int where, int ret)
|
|||
#endif
|
||||
if (!context)
|
||||
return;
|
||||
wsi = wsi_from_fd(context, SSL_get_fd(ssl));
|
||||
|
||||
fd = SSL_get_fd(ssl);
|
||||
if (fd < 0 || (fd - lws_plat_socket_offset()) < 0)
|
||||
return;
|
||||
|
||||
wsi = wsi_from_fd(context, fd);
|
||||
if (!wsi)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue