From 76838be540c998a66392d0267d7c9ee3b4a27a46 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Mon, 1 Jul 2024 11:44:14 +0200 Subject: executor: fix endianess of size of received flatbuffers root table Flatbuffers represents each scalar in little-endian format (https://flatbuffers.dev/flatbuffers_internals.html). Therefore, the size of the received root table must be converted to the host endianness format before its first usage. Signed-off-by: Alexander Egorenkov Fixes: e16e2c9a4cb6 ("executor: add runner mode") --- executor/conn.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'executor') diff --git a/executor/conn.h b/executor/conn.h index ace7d187b..ce9e3e7dc 100644 --- a/executor/conn.h +++ b/executor/conn.h @@ -2,6 +2,7 @@ // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. #include +#include #include #include #include @@ -44,6 +45,7 @@ public: typedef typename Msg::TableType Raw; flatbuffers::uoffset_t size; Recv(&size, sizeof(size)); + size = le32toh(size); recv_buf_.resize(size); Recv(recv_buf_.data(), size); auto raw = flatbuffers::GetRoot(recv_buf_.data()); -- cgit mrf-deployment