]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tools: fix possible null-deref in env_expand() on out-of-memory
authorWilly Tarreau <w@1wt.eu>
Fri, 31 May 2024 16:52:51 +0000 (18:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 31 May 2024 16:55:36 +0000 (18:55 +0200)
commitba958fb230d4add678913f18eb520d9d5935c968
treea2ca8f60ae9b3b3e7518f14e47daf379e59a814e
parent8a7afb6964b6f57c8d0481e2e391b7ec88552b26
BUG/MINOR: tools: fix possible null-deref in env_expand() on out-of-memory

In GH issue #2586 @Bbulatov reported a theoretical null-deref in
env_expand() in case there's no memory anymore to expand an environment
variable. The function should return NULL in this case so that the only
caller (str2sa_range) sees it. In practice it may only happen during
boot thus is harmless but better fix it since it's easy. This can be
backported to all versions where this applies.
src/tools.c