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]
Message-ID: <4A451A23.20307@redhat.com>
Date:	Fri, 26 Jun 2009 13:57:39 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH] debugfs: don't try to fclose NULL

do_logdump may jump to errout if fopen(out_file) fails, 
but in that case out_file is NULL, and fclose will segfault.

Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---

diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index 4818bc6..9a7108a 100644
--- a/debugfs/logdump.c
+++ b/debugfs/logdump.c
@@ -259,7 +259,7 @@ void do_logdump(int argc, char **argv)
 		close(journal_fd);
 
 errout:
-	if (out_file != stdout)
+	if (out_file && (out_file != stdout))
 		fclose(out_file);
 
 	return;

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