lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  5 Jul 2016 16:00:40 +0900
From:	Wang Shilong <wangshilong1991@...il.com>
To:	jack@...e.cz
Cc:	linux-ext4@...r.kernel.org, sihara@....com, lixi@....com,
	Wang Shilong <wshilong@....com>
Subject: [PATCH] quota: fix coredump if projid file dose not exist

From: Wang Shilong <wshilong@....com>

if '/etc/projid' dose not exist,@project_file will
be NULL pointer, fclose will cause coredump, add
check in endprent().

Signed-off-by: Wang Shilong <wshilong@....com>
---
 quotasys.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/quotasys.c b/quotasys.c
index c78e02c..d04f25a 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -98,8 +98,10 @@ void setprent(void)
 /* Close /etc/projid file */
 void endprent(void)
 {
-	fclose(project_file);
-	project_file = NULL;
+	if (project_file) {
+		fclose(project_file);
+		project_file = NULL;
+	}
 }
 
 /* Get next entry in /etc/projid */
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ