[Midnight Commander] #4561: tar: segault on copy fiiles from archive

1 view
Skip to first unread message

Ticket System

unread,
Jul 12, 2024, 1:17:33 PM (5 days ago) Jul 12
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segault on copy fiiles from archive
--------------------------------+--------------------------------
Reporter: andrew_b | Owner:
Type: defect | Status: new
Priority: trivial | Milestone: Future Releases
Component: mc-vfs | Version: master
Keywords: | Blocked By:
Blocking: | Branch state: no branch
Votes for changeset: |
--------------------------------+--------------------------------
Original bug report: https://bugzilla.altlinux.org/50857

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

Ticket System

unread,
Jul 12, 2024, 1:36:38 PM (5 days ago) Jul 12
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segault on copy fiiles from archive
--------------------------+--------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: accepted
Priority: trivial | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:
Branch state: on review | Votes for changeset:
--------------------------+--------------------------------
Changes (by andrew_b):

* 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 System

unread,
Jul 13, 2024, 1:30:44 AM (4 days ago) Jul 13
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive

--------------------------+--------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: accepted
Priority: trivial | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:

Branch state: on review | Votes for changeset:
--------------------------+--------------------------------

--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:2>

Ticket System

unread,
Jul 13, 2024, 1:32:40 AM (4 days ago) Jul 13
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive
--------------------------+--------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: accepted
Priority: trivial | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:

Branch state: on review | Votes for changeset:
--------------------------+--------------------------------

Comment (by andrew_b):

TODO before merge: fix commit message: s/segault/segfault

--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:3>

Ticket System

unread,
Jul 15, 2024, 2:37:43 PM (2 days ago) Jul 15
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive

-------------------------+--------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: accepted
Priority: trivial | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:
Branch state: approved | Votes for changeset: andrew_b
-------------------------+--------------------------------
Changes (by andrew_b):

* votes: => andrew_b
* branch_state: on review => approved


--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:4>

Ticket System

unread,
Jul 15, 2024, 2:43:39 PM (2 days ago) Jul 15
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive
-------------------------+----------------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: testing

Priority: trivial | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:
Branch state: merged | Votes for changeset: committed-master
-------------------------+----------------------------------------
Changes (by andrew_b):

* 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>

Ticket System

unread,
Jul 15, 2024, 2:48:30 PM (2 days ago) Jul 15
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive
-------------------------+----------------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: closed

Priority: trivial | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:

Branch state: merged | Votes for changeset: committed-master
-------------------------+----------------------------------------
Changes (by andrew_b):

* status: testing => closed


Comment:

Typos was not fixed :-((

--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:6>

Ticket System

unread,
Jul 15, 2024, 2:48:54 PM (2 days ago) Jul 15
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive
-------------------------+----------------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: closed
Priority: major | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:

Branch state: merged | Votes for changeset: committed-master
-------------------------+----------------------------------------
Changes (by andrew_b):

* priority: trivial => major


--
Ticket URL: <http://www.midnight-commander.org/ticket/4561#comment:7>

Ticket System

unread,
Jul 16, 2024, 4:23:32 PM (10 hours ago) Jul 16
to andrew....@gmail.com, mc-...@googlegroups.com
#4561: tar: segfault on copy fiiles from archive
-------------------------+----------------------------------------
Reporter: andrew_b | Owner: andrew_b
Type: defect | Status: closed
Priority: major | Milestone: 4.8.32
Component: mc-vfs | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:

Branch state: merged | Votes for changeset: committed-master
-------------------------+----------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages