]> git.ipfire.org Git - thirdparty/elfutils.git/commit
debuginfod-client: correct invalid free() in failed ima path
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 19 Feb 2025 03:09:12 +0000 (22:09 -0500)
committerFrank Ch. Eigler <fche@elastic.org>
Wed, 19 Feb 2025 03:09:52 +0000 (22:09 -0500)
commita71bac67f4705b84368b71f5ece54deedaa1abf1
tree30d5cb1bbad9d2a49dc02177f1c757322ab227a0
parentb16f441cca0a4841050e3215a9f120a6d8aea918
debuginfod-client: correct invalid free() in failed ima path

debuginfod-find with a failed signature configuration was found on f41
glibc (2.40) to sometimes leave invalid addresses in a sscanf("%ms", &ptr)
pointer in case of error, leading to an invalid free() during cleanup.
We now clear that ptr manually, making valgrind happy.  Unclear why this
hasn't shown up in testsuite testing.

==1098106== Invalid free() / delete / delete[] / realloc()
==1098106==    at 0x4844B83: free (vg_replace_malloc.c:989)
==1098106==    by 0x49647A2: ??? (in /usr/lib64/libdebuginfod-0.192.so)
==1098106==    by 0x401528: main (debuginfod-find.c:209)
==1098106==  Address 0xc8 is not stack'd, malloc'd or (recently) free'd

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
debuginfod/debuginfod-client.c