From: Stanislav Brabec Date: Fri, 16 May 2025 01:10:14 +0000 (+0200) Subject: libblkid: Fix crash while parsing config with libeconf X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=284527cff2bd22da2924881a4a4833049dca0d2e;p=thirdparty%2Futil-linux.git 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 Cc: Stefan Schubert Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1242705 --- diff --git a/libblkid/src/config.c b/libblkid/src/config.c index 934d28d65..39024b42e 100644 --- a/libblkid/src/config.c +++ b/libblkid/src/config.c @@ -154,7 +154,7 @@ struct blkid_config *blkid_read_config(const char *filename) #else /* !HAVE_LIBECONF */ - static econf_file *file = NULL; + econf_file *file = NULL; char *line = NULL; bool uevent = false; econf_err error;