From 007d5946b425bdbfccde76b89e05471ff91b738c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 25 May 2026 07:23:49 +0200 Subject: [PATCH] BUILD: intops: mask the fail value in array_size_or_fail() Cross-compilation on m68k fails in ssl_sock_resize_passphrase_cache() where the compiler noticed the SIZE_MAX passed to realloc() in the error path and complained that it's larger than PTRDIFF_MAX. This can be disabled with -Walloc-size-larger-than=SIZE_MAX but in practice we can simply hide the value and keep the warning to detect real failures elsewhere. Let's pass it through DISGUISE() and also take this opportunity for doing that inside an unlikely() clause since it's never supposed to happen. --- include/haproxy/intops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/haproxy/intops.h b/include/haproxy/intops.h index e1b637c30..08a9abc8b 100644 --- a/include/haproxy/intops.h +++ b/include/haproxy/intops.h @@ -121,8 +121,8 @@ static inline size_t array_size_or_fail(size_t m, size_t n) { size_t size; - if (mulsz_overflow(m, n, &size)) - return ~(size_t)0; + if (unlikely(mulsz_overflow(m, n, &size))) + return DISGUISE(~(size_t)0); return size; }