Title: [220907] releases/WebKitGTK/webkit-2.18/Source
Revision
220907
Author
[email protected]
Date
2017-08-18 00:48:32 -0700 (Fri, 18 Aug 2017)

Log Message

Merge r220860 - [WPE][GTK] Ensure proper casting of data in gvariants
https://bugs.webkit.org/show_bug.cgi?id=175667

Patch by Jacobo Aragunde Pérez <[email protected]> on 2017-08-17
Reviewed by Michael Catanzaro.

Source/_javascript_Core:

g_variant_new requires data to have the correct width for their types, using
casting if necessary. Some data of type `unsigned` were being saved to `guint64`
types without explicit casting, leading to undefined behavior in some platforms.

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
(Inspector::RemoteInspector::listingForAutomationTarget const):
(Inspector::RemoteInspector::sendMessageToRemote):

Source/WebKit:

g_variant_builder_add requires data to have the correct width for their types, using
casting if necessary. Corrected a call where a single precision float was being put
into a double precision parameter without a cast.

* UIProcess/API/glib/WebKitWebViewSessionState.cpp:
(encodeFrameState):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Source/_javascript_Core/ChangeLog (220906 => 220907)


--- releases/WebKitGTK/webkit-2.18/Source/_javascript_Core/ChangeLog	2017-08-18 07:47:41 UTC (rev 220906)
+++ releases/WebKitGTK/webkit-2.18/Source/_javascript_Core/ChangeLog	2017-08-18 07:48:32 UTC (rev 220907)
@@ -1,3 +1,19 @@
+2017-08-17  Jacobo Aragunde Pérez  <[email protected]>
+
+        [WPE][GTK] Ensure proper casting of data in gvariants
+        https://bugs.webkit.org/show_bug.cgi?id=175667
+
+        Reviewed by Michael Catanzaro.
+
+        g_variant_new requires data to have the correct width for their types, using
+        casting if necessary. Some data of type `unsigned` were being saved to `guint64`
+        types without explicit casting, leading to undefined behavior in some platforms.
+
+        * inspector/remote/glib/RemoteInspectorGlib.cpp:
+        (Inspector::RemoteInspector::listingForInspectionTarget const):
+        (Inspector::RemoteInspector::listingForAutomationTarget const):
+        (Inspector::RemoteInspector::sendMessageToRemote):
+
 2017-08-16  Csaba Osztrogonác  <[email protected]>
 
         Fix JSCOnly ARM buildbots after r220047 and r220184

Modified: releases/WebKitGTK/webkit-2.18/Source/_javascript_Core/inspector/remote/glib/RemoteInspectorGlib.cpp (220906 => 220907)


--- releases/WebKitGTK/webkit-2.18/Source/_javascript_Core/inspector/remote/glib/RemoteInspectorGlib.cpp	2017-08-18 07:47:41 UTC (rev 220906)
+++ releases/WebKitGTK/webkit-2.18/Source/_javascript_Core/inspector/remote/glib/RemoteInspectorGlib.cpp	2017-08-18 07:48:32 UTC (rev 220907)
@@ -187,7 +187,8 @@
         return nullptr;
 
     ASSERT(target.type() == RemoteInspectionTarget::Type::Web || target.type() == RemoteInspectionTarget::Type::_javascript_);
-    return g_variant_new("(tsssb)", target.targetIdentifier(), target.type() == RemoteInspectionTarget::Type::Web ? "Web" : "_javascript_",
+    return g_variant_new("(tsssb)", static_cast<guint64>(target.targetIdentifier()),
+        target.type() == RemoteInspectionTarget::Type::Web ? "Web" : "_javascript_",
         target.name().utf8().data(), target.type() == RemoteInspectionTarget::Type::Web ? target.url().utf8().data() : "null",
         target.hasLocalDebugger());
 }
@@ -194,7 +195,8 @@
 
 TargetListing RemoteInspector::listingForAutomationTarget(const RemoteAutomationTarget& target) const
 {
-    return g_variant_new("(tsssb)", target.targetIdentifier(), "Automation", target.name().utf8().data(), "null", target.isPaired());
+    return g_variant_new("(tsssb)", static_cast<guint64>(target.targetIdentifier()),
+        "Automation", target.name().utf8().data(), "null", target.isPaired());
 }
 
 void RemoteInspector::pushListingsNow()
@@ -274,7 +276,7 @@
 
     g_dbus_connection_call(m_dbusConnection.get(), nullptr,
         INSPECTOR_DBUS_OBJECT_PATH, INSPECTOR_DBUS_INTERFACE, "SendMessageToFrontend",
-        g_variant_new("(ts)", targetIdentifier, message.utf8().data()),
+        g_variant_new("(ts)", static_cast<guint64>(targetIdentifier), message.utf8().data()),
         nullptr, G_DBUS_CALL_FLAGS_NO_AUTO_START,
         -1, m_cancellable.get(), dbusConnectionCallAsyncReadyCallback, nullptr);
 }

Modified: releases/WebKitGTK/webkit-2.18/Source/WebKit/ChangeLog (220906 => 220907)


--- releases/WebKitGTK/webkit-2.18/Source/WebKit/ChangeLog	2017-08-18 07:47:41 UTC (rev 220906)
+++ releases/WebKitGTK/webkit-2.18/Source/WebKit/ChangeLog	2017-08-18 07:48:32 UTC (rev 220907)
@@ -1,3 +1,17 @@
+2017-08-17  Jacobo Aragunde Pérez  <[email protected]>
+
+        [WPE][GTK] Ensure proper casting of data in gvariants
+        https://bugs.webkit.org/show_bug.cgi?id=175667
+
+        Reviewed by Michael Catanzaro.
+
+        g_variant_builder_add requires data to have the correct width for their types, using
+        casting if necessary. Corrected a call where a single precision float was being put
+        into a double precision parameter without a cast.
+
+        * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
+        (encodeFrameState):
+
 2017-08-18  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r220854.

Modified: releases/WebKitGTK/webkit-2.18/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp (220906 => 220907)


--- releases/WebKitGTK/webkit-2.18/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp	2017-08-18 07:47:41 UTC (rev 220906)
+++ releases/WebKitGTK/webkit-2.18/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp	2017-08-18 07:48:32 UTC (rev 220907)
@@ -171,7 +171,7 @@
     g_variant_builder_add(sessionBuilder, "x", frameState.documentSequenceNumber);
     g_variant_builder_add(sessionBuilder, "x", frameState.itemSequenceNumber);
     g_variant_builder_add(sessionBuilder, "(ii)", frameState.scrollPosition.x(), frameState.scrollPosition.y());
-    g_variant_builder_add(sessionBuilder, "d", frameState.pageScaleFactor);
+    g_variant_builder_add(sessionBuilder, "d", static_cast<gdouble>(frameState.pageScaleFactor));
     if (!frameState.httpBody)
         g_variant_builder_add(sessionBuilder, HTTP_BODY_TYPE_STRING_V1, FALSE);
     else {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to