]> git.ipfire.org Git - thirdparty/elfutils.git/commit
debuginfod-client: Don't leak id/version with duplicate os-release entries
authorMark Wielaard <mark@klomp.org>
Sat, 22 Jun 2024 23:22:54 +0000 (01:22 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 22 Jun 2024 23:24:49 +0000 (01:24 +0200)
commitfe14f12fa4c1515725d42495dc6226650b778ac4
tree3511dfdfd69a8e4790cbec578d3acd83a32df09d
parent563d9d8d12c123ad48fd55a5b0e17840f5e78080
debuginfod-client: Don't leak id/version with duplicate os-release entries

Found by GCC14 -Wanalyzer-double-free.

If the os-release file would contain multiple ID or VERSION_ID entries
we would leak the originally parsed one. Fix by seeing whether id or
version is already set and ignore any future entries.

* debuginfod/debuginfod-client.c (add_default_headers): Check
whether id or version is already set before resetting them.

Signed-off-by: Mark Wielaard <mark@klomp.org>
debuginfod/debuginfod-client.c