[gdk-pixbuf] thumbnailer: Fix a potential NULL pointer dereference



commit 49dcd2d58ec3695f858c1db003851bd944a14f05
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Dec 12 22:47:07 2016 +0000

    thumbnailer: Fix a potential NULL pointer dereference
    
    In debug code on an error path: if the loader is not loaded due to
    mime_type being NULL, no error is set; so dereferencing it is a bad
    idea.
    
    Coverity CID 1388530
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776026

 thumbnailer/gdk-pixbuf-thumbnailer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c
index bd07d5e..a10483e 100644
--- a/thumbnailer/gdk-pixbuf-thumbnailer.c
+++ b/thumbnailer/gdk-pixbuf-thumbnailer.c
@@ -100,7 +100,8 @@ create_loader (GFile        *file,
   }
 
   if (loader == NULL) {
-    g_debug ("Unable to create loader for mime type %s: %s", mime_type, error->message);
+    g_debug ("Unable to create loader for mime type %s: %s", mime_type,
+             (error != NULL) ? error->message : "(null)");
     g_clear_error (&error);
     loader = gdk_pixbuf_loader_new ();
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]