https://bugs.webkit.org/show_bug.cgi?id=175667
Patch by Jacobo Aragunde Pérez <jaragunde@igalia.com> on 2017-08-17
Reviewed by Michael Catanzaro.
Source/JavaScriptCore:
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220860
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-17 Jacobo Aragunde Pérez <jaragunde@igalia.com>
+
+ [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-17 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Avoid code bloating for iteration if block does not have "break"
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());
}
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()
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);
}
+2017-08-17 Jacobo Aragunde Pérez <jaragunde@igalia.com>
+
+ [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-17 Don Olmstead <don.olmstead@sony.com>
[PAL] Move SessionID into PAL
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 {