Tar crashes when using -H or -L options with wildcards in Windows
jet2jet opened this issue · comments
Basic Information
- Version of libarchive: 3.7.4 (or HEAD of libarchive repo)
- How you obtained it: build from source, and a binary bundled in Windows (version is 3.6.2)
- Operating system and version: Windows 11 (10.0.22621.3447)
- What compiler and/or IDE you are using (include version): Visual Studio 2022 (17.7.0) / Microsoft C/C++ Compiler 19.37.32822
Description of the problem you are seeing:
- When executing
tar cf test.tar -L *.*
, tar abnormally exits with error code (-1073741819 == 0xC0000005).
How the libarchive developers can reproduce your problem:
- Simply type
tar cf test.tar -L *.*
ortar cf test.tar -H *.*
I debugged and found that the following line generates an exception (t->current
is null):
libarchive/libarchive/archive_read_disk_windows.c
Line 2188 in 136ce81
When using wildcards, the following code will not store t->current
, and it would be the cause of the above exception.
libarchive/libarchive/archive_read_disk_windows.c
Lines 1866 to 1895 in 136ce81