From c9f4b324bed8a1358502d16a90c6da6073426aaf Mon Sep 17 00:00:00 2001 From: BG2EBZ <1529185760@qq.com> Date: Sun, 5 Oct 2025 11:06:10 +0200 Subject: [PATCH] fix(ros2/server): remove unsafe slicing in UTF-8 decode to avoid truncation of JSON payload --- ros_tcp_endpoint/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros_tcp_endpoint/server.py b/ros_tcp_endpoint/server.py index 5954994..2f93c28 100644 --- a/ros_tcp_endpoint/server.py +++ b/ros_tcp_endpoint/server.py @@ -122,7 +122,7 @@ def handle_syscommand(self, topic, data): if function is None: self.send_unity_error("Don't understand SysCommand.'{}'".format(topic)) else: - message_json = data.decode("utf-8")[:-1] + message_json = data.decode("utf-8") params = json.loads(message_json) function(**params)