]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: haproxy: fix out-of-scope tmpdir usage in do_chroot()
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 18 Aug 2026 14:41:20 +0000 (14:41 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 18 Aug 2026 14:41:20 +0000 (14:41 +0000)
commitb39eb58ec706fb119a1aecc53f22b4581a399241
tree0c5a1c6d25df31e40b8780a13d6c450237e9191e
parent489163624c2e8f929d9eb86998aad978e68dc0d3
BUG/MINOR: haproxy: fix out-of-scope tmpdir usage in do_chroot()

Coverity (CID 1660133, GH #3470) reports that dir may point to the
block-local tmpdir[] array after it has gone out of scope, since dir
is read again in the "Cannot chroot()" alert past the end of the
"chroot auto" if-block. Move tmpdir's declaration to function scope
so its lifetime covers every use of dir.

Must be backported to 3.4.
src/haproxy.c