]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Bug fix (segfault): check filename against NULL in case we want
authorJean-Yves Migeon <jeanyves.migeon@free.fr>
Thu, 5 Sep 2013 13:27:52 +0000 (15:27 +0200)
committerJean-Yves Migeon <jeanyves.migeon@free.fr>
Thu, 5 Sep 2013 13:27:52 +0000 (15:27 +0200)
the output to go to stdout.

examples/minitar/minitar.c

index 709947cfa5b992a46311c727af565d39fa82a1e6..6b8b4f194cc6345e04c2cc90df346e15f9683876 100644 (file)
@@ -249,7 +249,7 @@ create(const char *filename, int compress, const char **argv)
                break;
        }
        archive_write_set_format_ustar(a);
-       if (strcmp(filename, "-") == 0)
+       if (filename != NULL && strcmp(filename, "-") == 0)
                filename = NULL;
        archive_write_open_filename(a, filename);