To be honest, the whole NautilusQuery code needs a rewrite. It's
entirely inadequate and sub-par (e.g. the usage of g_file_test() before
opening the file is a race, g_file_get_contents() is sync. i/o, etc).
Could do a couple of band-aid patches to prevent it from crashing, but
this is probably a fairly rare crash:

diff --git a/libnautilus-private/nautilus-query.c b/libnautilus-private/nautilus
index 267620d..b6a3f55 100644
--- a/libnautilus-private/nautilus-query.c
+++ b/libnautilus-private/nautilus-query.c
@@ -300,15 +300,18 @@ nautilus_query_load (char *file)
        NautilusQuery *query;
        char *xml;
        gsize xml_len;
-       
+
+       xml_len = 0;
+       query = NULL;
+
        if (!g_file_test (file, G_FILE_TEST_EXISTS)) {
                return NULL;
        }
-       
 
-       g_file_get_contents (file, &xml, &xml_len, NULL);
-       query = nautilus_query_parse_xml (xml, xml_len);
+       if (g_file_get_contents (file, &xml, &xml_len, NULL) && xml_len != 0) {
+               query = nautilus_query_parse_xml (xml, xml_len);
+       }

(then we have to make sure that the code's doing the right thing with
the NULL return, etc)

** Changed in: nautilus (Ubuntu)
   Importance: Undecided => Medium

** Changed in: nautilus (Ubuntu)
       Status: New => Triaged

** Changed in: nautilus (Ubuntu)
     Assignee: (unassigned) => Ubuntu Desktop Bugs (desktop-bugs)

-- 
Crash with empty .savedSearch file
https://bugs.launchpad.net/bugs/433673
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to