[Xfce4-commits] <tumbler:master> Avoid accessing list elements after they have been freed (bug #7418).

Jannis Pohlmann noreply at xfce.org
Sat Feb 25 16:14:01 CET 2012


Updating branch refs/heads/master
         to 3704cf3502bc8cafb4e7cd7956c0ae983a415b3e (commit)
       from 52802adb3361e9d3202d4a921b8b440660878ee1 (commit)

commit 3704cf3502bc8cafb4e7cd7956c0ae983a415b3e
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sat Feb 25 15:09:30 2012 +0000

    Avoid accessing list elements after they have been freed (bug #7418).

 NEWS                       |    1 +
 tumblerd/tumbler-manager.c |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index bcb3e8e..18426ce 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
 - Call dbus_g_thread_init() to fix threading issues (bug #7544).
 - Add application/vnd.rn-realmedia to the ffmpeg plugin (bug #6949).
 - Explicitly link against gmodule (bug #8466).
+- Avoid accessing list elements after they have been freed (bug #7418).
 
 0.1.23
 ======
diff --git a/tumblerd/tumbler-manager.c b/tumblerd/tumbler-manager.c
index cb8af5c..e8bf162 100644
--- a/tumblerd/tumbler-manager.c
+++ b/tumblerd/tumbler-manager.c
@@ -1433,6 +1433,7 @@ tumbler_manager_directory_deleted (TumblerManager *manager,
   GList           *delete_keys = NULL;
   GList          **list;
   GList           *lp;
+  GList           *next;
   gchar          **hash_keys;
   guint            n;
 
@@ -1454,9 +1455,10 @@ tumbler_manager_directory_deleted (TumblerManager *manager,
       g_assert (*list != NULL);
 
       /* iterate over all thumbnailers in the current list */
-      for (lp = *list; lp != NULL; lp = lp->next)
+      for (lp = *list; lp != NULL; )
         {
           info = lp->data;
+          next = lp->next;
 
           /* check if the thumbnailer info comes from the deleted directory */
           if (info->dir_index == dir_index)
@@ -1508,6 +1510,9 @@ tumbler_manager_directory_deleted (TumblerManager *manager,
               /* destroy the thumbnailer info */
               thumbnailer_info_free (info);
             }
+
+          /* advance to the next entry in the list */
+          lp = next;
         }
 
       if (*list == NULL)


More information about the Xfce4-commits mailing list