From 46f6c86362dd66c6dc8bef43cf9e2b7bea50a6cb Mon Sep 17 00:00:00 2001 From: Sviatoslav Peleshko Date: Sat, 8 Jan 2022 21:30:09 +0200 Subject: [PATCH] InspectorServer: Use the 32-bit data length when sending a request `length` was inheriting `size_t` type of the `String::length()`, while everywhere else in the Inspector we expect fixed 32-bit field. On the architectures where `sizeof(size_t) != sizeof(u32)` this broke the Inspector communication completely. --- Userland/Services/InspectorServer/InspectableProcess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Services/InspectorServer/InspectableProcess.cpp b/Userland/Services/InspectorServer/InspectableProcess.cpp index 578945c314..9e2c98f5f1 100644 --- a/Userland/Services/InspectorServer/InspectableProcess.cpp +++ b/Userland/Services/InspectorServer/InspectableProcess.cpp @@ -73,7 +73,7 @@ String InspectableProcess::wait_for_response() void InspectableProcess::send_request(JsonObject const& request) { auto serialized = request.to_string(); - auto length = serialized.length(); + u32 length = serialized.length(); m_socket->write((u8 const*)&length, sizeof(length)); m_socket->write(serialized); }