Title: [270825] trunk/Source/WebKit
Revision
270825
Author
[email protected]
Date
2020-12-15 01:15:17 -0800 (Tue, 15 Dec 2020)

Log Message

[SOUP] WebSockets: wrong data sent in some cases with libsoup < 2.68
https://bugs.webkit.org/show_bug.cgi?id=219850

Patch by Carlos Garcia Campos <[email protected]> on 2020-12-15
Reviewed by Michael Catanzaro.

We are using soup_websocket_connection_send_text() when libsoup < 2.68, which expects a null terminated string,
but we are receiving a IPC::DataReference that needs to be converted to a null terminated string by taking into
account its size.

* NetworkProcess/soup/WebSocketTaskSoup.cpp:
(WebKit::WebSocketTask::sendString):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (270824 => 270825)


--- trunk/Source/WebKit/ChangeLog	2020-12-15 07:06:32 UTC (rev 270824)
+++ trunk/Source/WebKit/ChangeLog	2020-12-15 09:15:17 UTC (rev 270825)
@@ -1,3 +1,17 @@
+2020-12-15  Carlos Garcia Campos  <[email protected]>
+
+        [SOUP] WebSockets: wrong data sent in some cases with libsoup < 2.68
+        https://bugs.webkit.org/show_bug.cgi?id=219850
+
+        Reviewed by Michael Catanzaro.
+
+        We are using soup_websocket_connection_send_text() when libsoup < 2.68, which expects a null terminated string,
+        but we are receiving a IPC::DataReference that needs to be converted to a null terminated string by taking into
+        account its size.
+
+        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
+        (WebKit::WebSocketTask::sendString):
+
 2020-12-14  Peng Liu  <[email protected]>
 
         [Media in GPU Process][MSE] VP9 stream playback is not smooth

Modified: trunk/Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp (270824 => 270825)


--- trunk/Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp	2020-12-15 07:06:32 UTC (rev 270824)
+++ trunk/Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp	2020-12-15 09:15:17 UTC (rev 270825)
@@ -210,7 +210,7 @@
         GRefPtr<GBytes> bytes = adoptGRef(g_bytes_new_static(utf8.data(), utf8.size()));
         soup_websocket_connection_send_message(m_connection.get(), SOUP_WEBSOCKET_DATA_TEXT, bytes.get());
 #else
-        soup_websocket_connection_send_text(m_connection.get(), reinterpret_cast<const char*>(utf8.data()));
+        soup_websocket_connection_send_text(m_connection.get(), CString(reinterpret_cast<const char*>(utf8.data()), utf8.size()).data());
 #endif
     }
     callback();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to