]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: deviceatlas: fix free() of an uninitialized cnew in checkinst
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 30 Nov 2026 10:57:48 +0000 (10:57 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 30 Nov 2026 10:59:48 +0000 (11:59 +0100)
commit52315d551cf03d67b87565237b65ec57ded26b04
tree65e091ccfc56903394095059f8f0c473e1966522
parentf52fdf6fa2e7939f9e75a312258074fb1f07739b
BUG/MINOR: deviceatlas: fix free() of an uninitialized cnew in checkinst

Reported by GitHub user brhenc in issue #3597 (a follow-up of the Coverity
report in #2428). In da_haproxy_checkinst(), "cnew" is filled by
da_atlas_compile(), which does not guarantee to write anything back to
the caller-supplied pointer when the compilation fails. The free() on
the error path could then be called on an indeterminate stack value and
crash the process. The fix introduced by d8ff676592 ("fix resource leak
on hot-reload compile failure") is preserved since free(NULL) is a no-op
if the library leaves the output untouched.

This must be backported to 3.4, 3.3, 3.2, 3.1 and 3.0, which all received
d8ff676592.
addons/deviceatlas/da.c