Title: [139890] trunk/Source/WebCore
Revision
139890
Author
[email protected]
Date
2013-01-16 10:00:17 -0800 (Wed, 16 Jan 2013)

Log Message

[GTK] Safeguard against possible NULL-dereference
https://bugs.webkit.org/show_bug.cgi?id=104931

Patch by Claudio Saavedra <[email protected]> on 2013-01-16
Reviewed by Martin Robinson.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetIndexInParent): Move the NULL-safeguard to a
place where it actually makes sense.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139889 => 139890)


--- trunk/Source/WebCore/ChangeLog	2013-01-16 17:49:03 UTC (rev 139889)
+++ trunk/Source/WebCore/ChangeLog	2013-01-16 18:00:17 UTC (rev 139890)
@@ -1,3 +1,14 @@
+2013-01-16  Claudio Saavedra  <[email protected]>
+
+        [GTK] Safeguard against possible NULL-dereference
+        https://bugs.webkit.org/show_bug.cgi?id=104931
+
+        Reviewed by Martin Robinson.
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetIndexInParent): Move the NULL-safeguard to a
+        place where it actually makes sense.
+
 2013-01-16  Avi Drissman  <[email protected]>
 
         West-panning cursor does not match resize cursor, unlike all other directions

Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (139889 => 139890)


--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-01-16 17:49:03 UTC (rev 139889)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-01-16 18:00:17 UTC (rev 139890)
@@ -407,9 +407,6 @@
     AccessibilityObject* coreObject = core(object);
     AccessibilityObject* parent = coreObject->parentObjectUnignored();
 
-    if (!parent)
-        return -1;
-
     if (!parent && isRootObject(coreObject)) {
         AtkObject* atkParent = atkParentOfRootObject(object);
         if (!atkParent)
@@ -430,6 +427,9 @@
     if (parent && parent->isTableRow() && coreObject->isTableCell())
         return getIndexInParentForCellInRow(coreObject);
 
+    if (!parent)
+        return -1;
+
     size_t index = parent->children().find(coreObject);
     return (index == WTF::notFound) ? -1 : index;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to