Michael Catanzaro 3108cac
From c565ece411b770856d5ae11eff1929a22133367b Mon Sep 17 00:00:00 2001
Michael Catanzaro 3108cac
From: Mike Gorse <mgorse@suse.com>
Michael Catanzaro 3108cac
Date: Tue, 31 May 2016 14:44:17 -0500
Michael Catanzaro 3108cac
Subject: atspi_accessible_clear_cache: don't crash if we have no children
Michael Catanzaro 3108cac
Michael Catanzaro 3108cac
If an accessible is disposed, then its list of children may be NULL.
Michael Catanzaro 3108cac
Michael Catanzaro 3108cac
https://bugzilla.gnome.org/show_bug.cgi?id=767075
Michael Catanzaro 3108cac
---
Michael Catanzaro 3108cac
 atspi/atspi-accessible.c | 5 +++--
Michael Catanzaro 3108cac
 1 file changed, 3 insertions(+), 2 deletions(-)
Michael Catanzaro 3108cac
Michael Catanzaro 3108cac
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
Michael Catanzaro 3108cac
index ceaedb5..4547ef7 100644
Michael Catanzaro 3108cac
--- a/atspi/atspi-accessible.c
Michael Catanzaro 3108cac
+++ b/atspi/atspi-accessible.c
Michael Catanzaro 3108cac
@@ -1634,8 +1634,9 @@ atspi_accessible_clear_cache (AtspiAccessible *obj)
Michael Catanzaro 3108cac
   if (obj)
Michael Catanzaro 3108cac
   {
Michael Catanzaro 3108cac
     obj->cached_properties = ATSPI_CACHE_NONE;
Michael Catanzaro 3108cac
-    for (i = 0; i < obj->children->len; i++)
Michael Catanzaro 3108cac
-      atspi_accessible_clear_cache (g_ptr_array_index (obj->children, i));
Michael Catanzaro 3108cac
+    if (obj->children)
Michael Catanzaro 3108cac
+      for (i = 0; i < obj->children->len; i++)
Michael Catanzaro 3108cac
+        atspi_accessible_clear_cache (g_ptr_array_index (obj->children, i));
Michael Catanzaro 3108cac
   }
Michael Catanzaro 3108cac
 }
Michael Catanzaro 3108cac
 
Michael Catanzaro 3108cac
-- 
Michael Catanzaro 3108cac
cgit v0.12
Michael Catanzaro 3108cac