From: Willy Tarreau Date: Thu, 26 May 2022 06:55:05 +0000 (+0200) Subject: CLEANUP: init: address another coverity warning about a possible multiply overflow X-Git-Tag: v2.6-dev12~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e5b9589b30dfb0801f5ae58493eea6d2fd83a34;p=thirdparty%2Fhaproxy.git CLEANUP: init: address another coverity warning about a possible multiply overflow Commit 2cb3be76b ("CLEANUP: init: address a coverity warning about possible multiply overflow") was incomplete, two other locations were present. This should address issue #1585. --- diff --git a/src/haproxy.c b/src/haproxy.c index 130bc9b354..203897b737 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2347,7 +2347,7 @@ static void init(int argc, char **argv) int64_t mem = global.rlimit_memmax * 1048576ULL; int64_t sslmem; - mem -= global.tune.sslcachesize * 200; // about 200 bytes per SSL cache entry + mem -= global.tune.sslcachesize * 200ULL; // about 200 bytes per SSL cache entry mem -= global.maxzlibmem; mem = mem * MEM_USABLE_RATIO; @@ -2380,7 +2380,7 @@ static void init(int argc, char **argv) int retried = 0; if (global.ssl_used_frontend || global.ssl_used_backend) - mem -= global.tune.sslcachesize * 200; // about 200 bytes per SSL cache entry + mem -= global.tune.sslcachesize * 200ULL; // about 200 bytes per SSL cache entry mem -= global.maxzlibmem; mem = mem * MEM_USABLE_RATIO;