summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2017-08-08 19:12:51 +0200
committerBastien Nocera <hadess@hadess.net>2017-08-08 19:16:00 +0200
commitb5a674a757d4ad934eb505f4e3c50ee1180f3693 (patch)
tree1585d634f66a91a4f59b3bdbe0a8ddd405a664b3
parentd9996c897e8cd2ffb5d7d8d3ad5016decdfa8201 (diff)
downloadgnome-desktop-b5a674a757d4ad934eb505f4e3c50ee1180f3693.tar.gz
thumbnail: Don't crash if the thumbnailer could not be setup
script_exec_new() can fail in certain cases, and we should not crash when trying to expand the script command later if the initial setup failed. https://bugzilla.gnome.org/show_bug.cgi?id=785963
-rw-r--r--libgnome-desktop/gnome-desktop-thumbnail-script.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgnome-desktop/gnome-desktop-thumbnail-script.c b/libgnome-desktop/gnome-desktop-thumbnail-script.c
index 5a5f05f4..d9437d40 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail-script.c
@@ -657,6 +657,9 @@ child_setup (gpointer user_data)
static void
script_exec_free (ScriptExec *exec)
{
+ if (exec == NULL)
+ return;
+
g_free (exec->infile);
if (exec->outfile)
{
@@ -757,6 +760,8 @@ gnome_desktop_thumbnail_script_exec (const char *cmd,
ScriptExec *exec;
exec = script_exec_new (uri);
+ if (!exec)
+ goto out;
expanded_script = expand_thumbnailing_cmd (cmd, exec, size, error);
if (expanded_script == NULL)
goto out;