aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-04-02 14:15:30 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-04-07 01:18:24 +0800
commit505895520025a9b7f266b50c96a745865f10a9a7 (patch)
tree85d1b9ca0794021646744c16cf949dd72d8ac795
parentd337ce9fedc74f7499536657bf82c2ee0bb57b0f (diff)
downloadgsoc2013-epiphany-505895520025a9b7f266b50c96a745865f10a9a7.tar.gz
gsoc2013-epiphany-505895520025a9b7f266b50c96a745865f10a9a7.tar.zst
gsoc2013-epiphany-505895520025a9b7f266b50c96a745865f10a9a7.zip
e-file-helpers: prevent invalid enumerator and return value
Invalid enumerators can be returned even when no GError is set. Check if the enumerator is non-NULL before proceeding, and adjust the default return value so it is not TRUE when g_file_enumerate_children fails. https://bugzilla.gnome.org/show_bug.cgi?id=673337
-rw-r--r--lib/ephy-file-helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 34b2d33e7..3f7b7d0ea 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -858,12 +858,12 @@ ephy_file_delete_dir_recursively (GFile *directory, GError **error)
{
GFileEnumerator *children = NULL;
GFileInfo *info;
- gboolean ret = TRUE;
+ gboolean ret = FALSE;
children = g_file_enumerate_children (directory,
"standard::name,standard::type",
0, NULL, error);
- if (error)
+ if (children == NULL || error)
goto out;
info = g_file_enumerator_next_file (children, NULL, error);