]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Revert "BUG/MINOR: send-proxy-v2: string size must include ('\0')"
authorEmmanuel Hocdet <manu@gandi.net>
Wed, 28 Feb 2018 11:02:14 +0000 (12:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Mar 2018 05:48:05 +0000 (06:48 +0100)
This reverts commit 82913e4f79a1f1fb25aec84a2ce2f5f0e5ce1959.
TLV string value should not be null-terminated.

This should be backported to 1.8.

src/connection.c

index 48d7a64de37fed84539c322f063faaf4e5682c10..11cc363733d3986e480affb234282cbc7686534e 100644 (file)
@@ -1057,7 +1057,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)+1, value);
+                               ssl_tlv_len += make_tlv(&buf[ret+ssl_tlv_len], (buf_len-ret-ssl_tlv_len), PP2_SUBTYPE_SSL_VERSION, strlen(value), value);
                        }
                        if (ssl_sock_get_cert_used_sess(remote)) {
                                tlv->client |= PP2_CLIENT_CERT_SESS;