linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-map-logical: segfaults when no output file is given
@ 2011-03-14 11:57 Arne Jansen
  0 siblings, 0 replies; only message in thread
From: Arne Jansen @ 2011-03-14 11:57 UTC (permalink / raw)
  To: chris.mason, linux-btrfs

when no output file is given, info_file stays NULL and the following
fprintf segfaults. Default to stdout.
---
 btrfs-map-logical.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c
index a109c6a..aa4b5b5 100644
--- a/btrfs-map-logical.c
+++ b/btrfs-map-logical.c
@@ -175,6 +175,7 @@ int main(int ac, char **av)
 		exit(1);
 	}
 
+	info_file = stdout;
 	if (output_file) {
 		if (strcmp(output_file, "-") == 0) {
 			out_fd = 1;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-14 11:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-14 11:57 [PATCH] btrfs-map-logical: segfaults when no output file is given Arne Jansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).