BUG/MINOR: send-proxy-v2: string size must include ('\0')

strlen() exclude the terminating null byte ('\0'), add it.
This commit is contained in:
Emmanuel Hocdet 2017-10-31 18:31:36 +01:00 committed by Willy Tarreau
parent 571c7ac0a5
commit 82913e4f79

View File

@ -1056,7 +1056,7 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec
tlv->client |= PP2_CLIENT_SSL;
value = ssl_sock_get_proto_version(remote);
if (value) {
ssl_tlv_len += make_tlv(&buf[ret+ssl_tlv_len], (buf_len-ret-ssl_tlv_len), PP2_SUBTYPE_SSL_VERSION, strlen(value), value);
ssl_tlv_len += make_tlv(&buf[ret+ssl_tlv_len], (buf_len - ret - ssl_tlv_len), PP2_SUBTYPE_SSL_VERSION, strlen(value)+1, value);
}
if (ssl_sock_get_cert_used_sess(remote)) {
tlv->client |= PP2_CLIENT_CERT_SESS;