[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] BUG: segfault with tar --index-file=bad_path
From: |
Paul Eggert |
Subject: |
Re: [Bug-tar] BUG: segfault with tar --index-file=bad_path |
Date: |
Wed, 11 Jan 2012 11:38:41 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 |
Thanks for reporting that. I installed this fix and it
should appear in the next 'tar' version.
tar: fix core dump with --index-file=bad_path
* src/tar.c (decode_options): Exit cleanly if index file won't open.
Problem reported by Khanh-Dang Nguyen Thu Lam in
<http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00018.html>.
diff --git a/src/tar.c b/src/tar.c
index 21d9910..9cea7a5 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -1549,7 +1549,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
/* Don't replace existing files. */
old_files_option = KEEP_OLD_FILES;
break;
-
+
case 'K':
starting_file_option = true;
addname (arg, 0, true, NULL);
@@ -2606,7 +2606,7 @@ decode_options (int argc, char **argv)
{
stdlis = fopen (index_file_name, "w");
if (! stdlis)
- open_error (index_file_name);
+ open_fatal (index_file_name);
}
else
stdlis = to_stdout_option ? stderr : stdout;