GNOME Bugzilla – Bug 770968
segfault on batch rename if the files are removed midway
Last modified: 2016-09-08 18:56:25 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
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.
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!!
Attachment 335024 [details] pushed as edf8159 - nautilus-file: Fix segfault on batch rename for file gone