The simplest archive that bug is reproduced with is attached.
How to reproduce:
1. Enter to the test.tar.
2. Copy the top `test` directory with F5.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561>
Midnight Commander <https://midnight-commander.org>
Midnight Development Center
* owner: => andrew_b
* status: new => accepted
* branch_state: no branch => on review
* milestone: Future Releases => 4.8.32
Comment:
Branch: 4561_tar_segfault
changeset:a9a1451fd488ab9ffb50f2d55f42f80dd7e70a8b
The cause of segfault is endless recursive call of do_compute_dir_size()
because of incorrect handling of very long file/directory name. As a
result the structure of opened tar archive may contain a directory with an
empty name.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:1>
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:2>
Comment (by andrew_b):
TODO before merge: fix commit message: s/segault/segfault
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:3>
* votes: => andrew_b
* branch_state: on review => approved
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:4>
* status: accepted => testing
* votes: andrew_b => committed-master
* resolution: => fixed
* branch_state: approved => merged
Comment:
Merged to master: [9f4e88fd7022e9946004026df4725903434d23ac].
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:5>
* status: testing => closed
Comment:
Typos was not fixed :-((
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:6>
* priority: trivial => major
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:7>
Comment (by cieply):
Can confirm it doesn't crash any more.
Also, for sake of simplicity, the tar file used as example should be
compressed. It wouldn't change the outcome but would decrease attachment
40 times.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:8>