After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770968 - segfault on batch rename if the files are removed midway
segfault on batch rename if the files are removed midway
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.21.x
Other Linux
: Normal normal
: 3.22
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-06 19:48 UTC by Mohammed Sadiq
Modified: 2016-09-08 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
nautilus-file: Fix segfault on batch rename for file gone (1.22 KB, patch)
2016-09-07 20:00 UTC, Alexandru Pandelea
committed Details | Review

Description Mohammed Sadiq 2016-09-06 19:48:19 UTC
How to reproduce:

1. Create some files:
   touch test{00..10}.txt
2. Select all and rename.
   Select some combination
3. Now before clicking the "Rename", remove the file some other way.
   Eg, using coreutils: rm test*.txt
4. Now click "Rename". Nautilus segfaults here
Comment 1 Alexandru Pandelea 2016-09-07 20:00:34 UTC
Created attachment 335024 [details] [review]
nautilus-file: Fix segfault on batch rename for file gone

If one or more files are deleted during a batch rename and click rename,
Nautilus would seg fault.

The problem is that in the function nautilus_file_rename_handle_file_gone
there was called a callback that was NULL. For batch renaming, there is no
need for a callback here.
Comment 2 Carlos Soriano 2016-09-08 08:41:01 UTC
Review of attachment 335024 [details] [review]:

Oh yes, this is SO wrong... it's basic to always check if the callback is there. I wonder how we survived :)

Small nitpick, feel free to commit directly after modifying this:
"there was called a callback that was NULL" -> "We weren't checking if a callback was provided as a parameter before actually calling the callback, so a NULL callback would make Nautilus crash" or something like this.

Thanks!!
Comment 3 Alexandru Pandelea 2016-09-08 18:56:20 UTC
Attachment 335024 [details] pushed as edf8159 - nautilus-file: Fix segfault on batch rename for file gone