]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: Fix crash while parsing config with libeconf
authorStanislav Brabec <sbrabec@suse.cz>
Fri, 16 May 2025 01:10:14 +0000 (03:10 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 19 Jun 2025 08:24:36 +0000 (10:24 +0200)
commit4288a28d35f77e3238735a1431206ed909e13ae8
treefb5160965d3316c97f8d4037677a71236cc4b242
parentb75b2c9b9e068cfb13f25ea38a78e2202e38c192
libblkid: Fix crash while parsing config with libeconf

As the whole econf_file structure is freed by econf_free(file) at the end
of blkid_read_config(), econf_file structure cannot be defined as static
and initialized only once. The econf_free() is not robust enough and keeps
a pointer to the garbage after the first call of blkid_read_config(). And
if /etc/blkid.conf does not exist, it is called second time.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Stefan Schubert <schubi@suse.de>
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1242705
(cherry picked from commit 284527cff2bd22da2924881a4a4833049dca0d2e)
libblkid/src/config.c