8000 libblkid: Fix crash while parsing config with libeconf · util-linux/util-linux@284527c · GitHub
[go: up one dir, main page]

Skip to content

Commit 284527c

Browse files
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
1 parent 0a21358 commit 284527c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libblkid/src/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct blkid_config *blkid_read_config(const char *filename)
154154

155155
#else /* !HAVE_LIBECONF */
156156

157-
static econf_file *file = NULL;
157+
econf_file *file = NULL;
158158
char *line = NULL;
159159
bool uevent = false;
160160
econf_err error;

0 commit comments

Comments
 (0)
0