btrfs-map-logical: segfaults when no output file is given
authorArne Jansen <sensille@gmx.net>
Mon, 14 Mar 2011 11:57:49 +0000 (12:57 +0100)
committerChris Mason <chris.mason@oracle.com>
Tue, 25 Oct 2011 13:18:58 +0000 (09:18 -0400)
when no output file is given, info_file stays NULL and the following
fprintf segfaults. Default to stdout.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
btrfs-map-logical.c

index 6d3ef7a..d79a73a 100644 (file)
@@ -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;