]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: tree-wide: use array_size_or_fail() in array size for allocations
authorWilly Tarreau <w@1wt.eu>
Wed, 20 May 2026 15:02:53 +0000 (17:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 May 2026 15:05:19 +0000 (17:05 +0200)
commitf5477c8d4522651345cba34206db821c0a43fa93
tree27d5ca875bc2c356d2cdc7165db775b8ee55a510
parentb62ba7592adf68dc594723f0eaabe69e68a30e71
CLEANUP: tree-wide: use array_size_or_fail() in array size for allocations

Instead of relying on malloc(n*size), we now pass array_size_or_fail(n,m)
so that it becomes possible to detect overflow. This is particularly
interesting for global settings that might be set large enough to cause
overflows on 32-bit systems for example, resulting in small values that
then cause trouble. Now the overflow will be detected at allocation time.
Around 25 locations were updated.
15 files changed:
src/cfgparse-ssl.c
src/cfgparse.c
src/cli.c
src/errors.c
src/fd.c
src/haproxy.c
src/log.c
src/resolvers.c
src/server.c
src/sock.c
src/ssl_ckch.c
src/ssl_sock.c
src/stats-file.c
src/stats.c
src/stick_table.c