]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connection: fix proxy v2 header again!
authorWilly Tarreau <w@1wt.eu>
Sat, 19 Jul 2014 04:37:33 +0000 (06:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 19 Jul 2014 04:37:33 +0000 (06:37 +0200)
Last commit 77d1f01 ("BUG/MEDIUM: connection: fix memory corruption
when building a proxy v2 header") was wrong, using &cn_trash instead
of cn_trash resulting in a warning and the client's SSL cert CN not
being stored at the proper location.

Thanks to Lukas Tribus for spotting this quickly.

This should be backported to 1.5 after the patch above is backported.

src/connection.c

index 3435b1ac74462d9c48efad4d39c674e125499f51..2dd2c024aaee41df549da63e78d7e525d4768230 100644 (file)
@@ -684,7 +684,7 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec
                        }
                        if (srv->pp_opts & SRV_PP_V2_SSL_CN) {
                                cn_trash = get_trash_chunk();
-                               if (ssl_sock_get_remote_common_name(remote, &cn_trash) > 0) {
+                               if (ssl_sock_get_remote_common_name(remote, cn_trash) > 0) {
                                        tlv_len = make_tlv(&buf[ret+ssl_tlv_len], (buf_len - ret - ssl_tlv_len), PP2_TYPE_SSL_CN, cn_trash->len, cn_trash->str);
                                        ssl_tlv_len += tlv_len;
                                }