← Commit list

558aae1a3

Denys Vlasenko
Denys Vlasenko
2017-07-04
SUCCESS Duration: 145s

Subject

tls: use capped SNI len everywhere

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/tls.c+2 -2
@@ -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);