[WPE][GTK] Ensure proper casting of data in gvariants
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Aug 2017 16:17:19 +0000 (16:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Aug 2017 16:17:19 +0000 (16:17 +0000)
commit6d24b786a763881cc83aceb9e3a153be695f6eaf
treeb5a39efccc1c72a046cd4fdd53e251205a9dd241
parent6ad6057f8b9dcad35be6c93eaa1042bde1296300
[WPE][GTK] Ensure proper casting of data in gvariants
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
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp