[PATCH] libblkid: Fix crash while parsing config with libeconf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As the whhole 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. And if /etc/blkid.conf does
not exist, it is called second time.

Signed-off-by: Stanislav Brabec <sbrabec@xxxxxxx>
Cc: Stefan Schubert <schubi@xxxxxxx>
---
 libblkid/src/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.48.1





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux