]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: Wrong usage of shctx_init().
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 25 Oct 2018 18:22:46 +0000 (20:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 26 Oct 2018 02:54:40 +0000 (04:54 +0200)
With this patch we check that shctx_init() does not return 0.

Must be backported to 1.8.

src/ssl_sock.c

index 140f406b5e3824827d30c15e890a78b45c30e1c3..50af63b209ec6c5b295632e014e3c4d338bf38b1 100644 (file)
@@ -4789,7 +4789,7 @@ int ssl_sock_prepare_bind_conf(struct bind_conf *bind_conf)
                                       sizeof(struct sh_ssl_sess_hdr) + SHSESS_BLOCK_MIN_SIZE, -1,
                                       sizeof(*sh_ssl_sess_tree),
                                       ((global.nbthread > 1) || (!global_ssl.private_cache && (global.nbproc > 1))) ? 1 : 0);
-               if (alloc_ctx < 0) {
+               if (alloc_ctx <= 0) {
                        if (alloc_ctx == SHCTX_E_INIT_LOCK)
                                ha_alert("Unable to initialize the lock for the shared SSL session cache. You can retry using the global statement 'tune.ssl.force-private-cache' but it could increase CPU usage due to renegotiations if nbproc > 1.\n");
                        else