diff options
Diffstat (limited to 'networking/tls.c')
-rw-r--r-- | networking/tls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/tls.c b/networking/tls.c index db518bf90..fd3cb0dba 100644 --- a/networking/tls.c +++ b/networking/tls.c @@ -1199,11 +1199,11 @@ static void send_client_hello_and_alloc_hsd(tls_state_t *tls, const char *sni) }; struct client_hello *record; int len; - int sni_len = sni ? strnlen(sni, 127) : 0; + int sni_len = sni ? strnlen(sni, 127 - 9) : 0; len = sizeof(*record); if (sni_len) - len += 11 + strlen(sni); + len += 11 + sni_len; record = tls_get_outbuf(tls, len); memset(record, 0, len); |