diff options
author | Denys Vlasenko | 2017-07-04 16:52:45 +0200 |
---|---|---|
committer | Denys Vlasenko | 2017-07-04 16:52:45 +0200 |
commit | 558aae1a3384fce626d98608730f3b2d919bb78f (patch) | |
tree | 3bd0b4b219847db780929442e6ad1bb62f04624a /networking | |
parent | 034ceabe8221fb924277cd6b1e07303ecb93408f (diff) | |
download | busybox-558aae1a3384fce626d98608730f3b2d919bb78f.zip busybox-558aae1a3384fce626d98608730f3b2d919bb78f.tar.gz |
tls: use capped SNI len everywhere
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-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 db518bf..fd3cb0d 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); |