From: Paul Eggert Date: Tue, 7 Apr 2026 18:05:23 +0000 (-0700) Subject: Disallow --one-top-level=''. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=b4fc9ca13617411c5db57286a3ff534bd40acdc1;p=thirdparty%2Ftar.git Disallow --one-top-level=''. * src/tar.c (decode_options): Do not accept an empty string as a relative file name. --- diff --git a/src/tar.c b/src/tar.c index 1ee5ed41..1df9460c 100644 --- a/src/tar.c +++ b/src/tar.c @@ -2688,7 +2688,9 @@ decode_options (int argc, char **argv) "please set it explicitly with --one-top-level=DIR")); } - if (one_top_level_dir && !IS_RELATIVE_FILE_NAME (one_top_level_dir)) + if (one_top_level_dir + && ! (*one_top_level_dir + && IS_RELATIVE_FILE_NAME (one_top_level_dir))) paxusage(_("--one-top-level=DIR must use a relative file name")); }