[at-spi] Avoid crash if atk_document_get_attributes returns NULL



commit 24a2d9730ac6254fe944c221672d2dbb922b430d
Author: Mike Gorse <mgorse boston site>
Date:   Wed Jun 3 14:12:27 2009 -0500

    Avoid crash if atk_document_get_attributes returns NULL
    
    Bug #584467.  Have impl_getAttributes always return a non-NULL attribute
    set, even if atk_document_get_attributes returns NULL.
---
 libspi/document.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libspi/document.c b/libspi/document.c
index dde6b9b..764c5da 100644
--- a/libspi/document.c
+++ b/libspi/document.c
@@ -107,11 +107,9 @@ impl_getAttributes (PortableServer_Servant servant,
   
   attributes = atk_document_get_attributes (document);
 
-  if (!attributes)
-    return NULL;  
-
   /* according to atkobject.h, AtkAttributeSet is a GSList */
-  n_attributes = g_slist_length (attributes);
+  if (attributes)
+    n_attributes = g_slist_length (attributes);
     
   retval = CORBA_sequence_CORBA_string__alloc ();
   retval->_length = retval->_maximum = n_attributes;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]