summaryrefslogtreecommitdiff
path: root/thumbnailer
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2016-12-12 22:47:07 +0000
committerBastien Nocera <hadess@hadess.net>2016-12-19 19:01:18 +0100
commit49dcd2d58ec3695f858c1db003851bd944a14f05 (patch)
tree7b8493f99f5c608d29b9a0d9df55396af3c5c5e9 /thumbnailer
parent5b15f3406a800ffef06906b4ddfedff61318c176 (diff)
downloadgdk-pixbuf-49dcd2d58ec3695f858c1db003851bd944a14f05.tar.gz
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
Diffstat (limited to 'thumbnailer')
-rw-r--r--thumbnailer/gdk-pixbuf-thumbnailer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c
index bd07d5e16..a10483e15 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 ();
}