Fix a segfault
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 18 Jul 2008 17:48:30 +0000 (17:48 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 18 Jul 2008 17:48:30 +0000 (17:48 +0000)
svn path=/trunk/; revision=7200

gio/ChangeLog
gio/gfile.c

index 61e9f33265bd18ac2dd231af5a51a051dba36acd..6029a6efe4825c0f7bb4c4c7d0e55452f7d5088e 100644 (file)
@@ -1,3 +1,22 @@
+2008-07-18  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 543040 – async reading on dummy file will crash on
+       GIO_USE_VFS=local
+
+       * gfile.c (open_read_async_thread): Cope with read_fn being
+       NULL. Reported by Lin Ma.  
+
+2008-07-18  Matthias Clasen  <mclasen@redhat.com>
+
+       * gio.symbols:
+       * gcontenttype.[hc]: Add g_content_type_guess_for_tree().
+
+2008-07-16  Matthias Clasen  <mclasen@redhat.com>
+
+       * gvfs.h:
+       * gdesktopappinfo.h: 
+       * giomodule.c: Rename a chapter id to avoid filename conflict.
+
 2008-07-16  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 540616 – mem leak in filechooser button
index 2dd40ba00a1d6409fc09a683fbf5996612fe8710..e056942a16adeafd7ba39fa71ed911c5d80ee4f2 100644 (file)
@@ -4198,6 +4198,18 @@ open_read_async_thread (GSimpleAsyncResult *res,
 
   iface = G_FILE_GET_IFACE (object);
 
+  if (iface->read_fn == NULL)
+    {
+      g_set_error_literal (error, G_IO_ERROR,
+                           G_IO_ERROR_NOT_SUPPORTED,
+                           _("Operation not supported"));
+
+      g_simple_async_result_set_from_error (res, error);
+      g_error_free (error);
+
+      return;
+    }
+  
   stream = iface->read_fn (G_FILE (object), cancellable, &error);
 
   if (stream == NULL)