bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tar 1.33 TAR_OPTIONS parser bug


From: Christian Weisgerber
Subject: tar 1.33 TAR_OPTIONS parser bug
Date: Sun, 17 Jan 2021 17:12:33 +0100

Commit 1ff0b63f4898 "Accept only position-sensitive (file-selection)
options in file list files" has introduced a pointer indirection
bug that breaks TAR_OPTIONS parsing.

The problem shows up when running the test suite on FreeBSD 12.2
where it can be simplified to this reproducer:

$ export 
TAR_OPTIONS='--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime'
$ tar
Segmentation fault (core dumped)

Here's the fix:

--- src/tar.c.orig      2021-01-17 15:26:53 UTC
+++ src/tar.c
@@ -2248,7 +2248,7 @@ parse_default_options (struct tar_args *args)
       if (argp_parse (&argp,
                      ws.ws_offs + ws.ws_wordc,
                      ws.ws_wordv,
-                     ARGP_IN_ORDER|ARGP_NO_EXIT, &idx, &args))
+                     ARGP_IN_ORDER|ARGP_NO_EXIT, &idx, args))
        abort (); /* shouldn't happen */
       args->loc = save_loc_ptr;
       if (name_more_files ())
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]