From 505895520025a9b7f266b50c96a745865f10a9a7 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Mon, 2 Apr 2012 01:15:30 -0500 Subject: 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 --- lib/ephy-file-helpers.c | 4 ++-- 1 file 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); -- cgit