mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Coverity 189189: client: new openssl alpn handling off-by-one
This commit is contained in:
parent
a7db6e4fd4
commit
9586acb560
1 changed files with 1 additions and 1 deletions
|
@ -240,7 +240,7 @@ lws_tls_client_connect(struct lws *wsi)
|
|||
#if defined(LWS_HAVE_SSL_set_alpn_protos) && defined(LWS_HAVE_SSL_get0_alpn_selected)
|
||||
SSL_get0_alpn_selected(wsi->ssl, &prot, &len);
|
||||
|
||||
if (len > sizeof(a))
|
||||
if (len >= sizeof(a))
|
||||
len = sizeof(a) - 1;
|
||||
memcpy(a, (const char *)prot, len);
|
||||
a[len] = '\0';
|
||||
|
|
Loading…
Add table
Reference in a new issue