From 48d29930ed29bc92ac5ea08cb72553896d2f7da5 Mon Sep 17 00:00:00 2001 From: Arne Jansen Date: Mon, 14 Mar 2011 12:57:49 +0100 Subject: [PATCH] btrfs-map-logical: segfaults when no output file is given when no output file is given, info_file stays NULL and the following fprintf segfaults. Default to stdout. Signed-off-by: Arne Jansen Signed-off-by: Hugo Mills --- btrfs-map-logical.c | 1 + 1 file changed, 1 insertion(+) diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index 6d3ef7ab..d79a73a9 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -173,6 +173,7 @@ int main(int ac, char **av) exit(1); } + info_file = stdout; if (output_file) { if (strcmp(output_file, "-") == 0) { out_fd = 1;