Title: [289808] releases/WebKitGTK/webkit-2.34/Source
Revision
289808
Author
[email protected]
Date
2022-02-15 06:30:27 -0800 (Tue, 15 Feb 2022)

Log Message

Merge r289804 - [GTK] D-Bus crash atk-bridge
https://bugs.webkit.org/show_bug.cgi?id=236208

Reviewed by Adrian Perez de Castro.

Source/WebCore:

When a root is unregistered, check first if the registration is still pending to just complete and remove it.

* accessibility/atspi/AccessibilityAtspi.cpp:
(WebCore::AccessibilityAtspi::unregisterRoot):

Source/WebKit:

It seems that for some reason we might end up with an empty string as plug ID which ATK doesn't handle right. We
should not send the BindAccessibilityTree message if the plug ID is not valid. In the case of ATSPI we can just
check it's not empty, since we know we always build a valid ID when we have a connection. In the case of ATK we
should check it's a valid unique name and object path.

* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog (289807 => 289808)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog	2022-02-15 14:23:17 UTC (rev 289807)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog	2022-02-15 14:30:27 UTC (rev 289808)
@@ -1,3 +1,15 @@
+2022-02-15  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] D-Bus crash atk-bridge
+        https://bugs.webkit.org/show_bug.cgi?id=236208
+
+        Reviewed by Adrian Perez de Castro.
+
+        When a root is unregistered, check first if the registration is still pending to just complete and remove it.
+
+        * accessibility/atspi/AccessibilityAtspi.cpp:
+        (WebCore::AccessibilityAtspi::unregisterRoot):
+
 2022-02-15  Adrian Perez de Castro  <[email protected]>
 
         [GTK][WPE] Inclusion of OpenGLShims.h should not depend on USE(GLX)

Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog (289807 => 289808)


--- releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog	2022-02-15 14:23:17 UTC (rev 289807)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog	2022-02-15 14:30:27 UTC (rev 289808)
@@ -1,3 +1,18 @@
+2022-02-15  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] D-Bus crash atk-bridge
+        https://bugs.webkit.org/show_bug.cgi?id=236208
+
+        Reviewed by Adrian Perez de Castro.
+
+        It seems that for some reason we might end up with an empty string as plug ID which ATK doesn't handle right. We
+        should not send the BindAccessibilityTree message if the plug ID is not valid. In the case of ATSPI we can just
+        check it's not empty, since we know we always build a valid ID when we have a connection. In the case of ATK we
+        should check it's a valid unique name and object path.
+
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::platformInitialize):
+
 2022-02-15  Adrian Perez de Castro  <[email protected]>
 
         [GTK][WPE] Inclusion of OpenGLShims.h should not depend on USE(GLX)

Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp (289807 => 289808)


--- releases/WebKitGTK/webkit-2.34/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp	2022-02-15 14:23:17 UTC (rev 289807)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp	2022-02-15 14:30:27 UTC (rev 289808)
@@ -61,9 +61,28 @@
     // entry point to the Web process, and send a message to the UI
     // process to connect the two worlds through the accessibility
     // object there specifically placed for that purpose (the socket).
+    auto isValidPlugID = [](const char* plugID) -> bool {
+        if (!plugID || plugID[0] != ':')
+            return false;
+
+        auto* p = g_strrstr(plugID, ":");
+        if (!p)
+            return false;
+
+        if (!g_variant_is_object_path(p + 1))
+            return false;
+
+        GUniquePtr<char> name(g_strndup(plugID, p - plugID));
+        if (!g_dbus_is_unique_name(name.get()))
+            return false;
+
+        return true;
+    };
+
     m_accessibilityObject = adoptGRef(webkitWebPageAccessibilityObjectNew(this));
     GUniquePtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject.get())));
-    send(Messages::WebPageProxy::BindAccessibilityTree(String(plugID.get())));
+    if (isValidPlugID(plugID.get()))
+        send(Messages::WebPageProxy::BindAccessibilityTree(String(plugID.get())));
 #endif
 }
 

Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp (289807 => 289808)


--- releases/WebKitGTK/webkit-2.34/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp	2022-02-15 14:23:17 UTC (rev 289807)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp	2022-02-15 14:30:27 UTC (rev 289808)
@@ -43,9 +43,28 @@
     // entry point to the web process, and send a message to the UI
     // process to connect the two worlds through the accessibility
     // object there specifically placed for that purpose (the socket).
+    auto isValidPlugID = [](const char* plugID) -> bool {
+        if (!plugID || plugID[0] != ':')
+            return false;
+
+        auto* p = g_strrstr(plugID, ":");
+        if (!p)
+            return false;
+
+        if (!g_variant_is_object_path(p + 1))
+            return false;
+
+        GUniquePtr<char> name(g_strndup(plugID, p - plugID));
+        if (!g_dbus_is_unique_name(name.get()))
+            return false;
+
+        return true;
+    };
+
     m_accessibilityObject = adoptGRef(webkitWebPageAccessibilityObjectNew(this));
     GUniquePtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject.get())));
-    send(Messages::WebPageProxy::BindAccessibilityTree(String::fromUTF8(plugID.get())));
+    if (isValidPlugID(plugID.get()))
+        send(Messages::WebPageProxy::BindAccessibilityTree(String::fromUTF8(plugID.get())));
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to