From 95f62d9a4565b6b9a181a1eebcbbd0f94d57fc41 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Fri, 10 Mar 2023 09:55:44 +0800 Subject: [PATCH] test/crimson/test_socket: fix unaligned memory access Signed-off-by: Yingxin Cheng --- src/test/crimson/test_socket.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/crimson/test_socket.cc b/src/test/crimson/test_socket.cc index 6d082c101bfbf..916583cc5c5f2 100644 --- a/src/test/crimson/test_socket.cc +++ b/src/test/crimson/test_socket.cc @@ -341,7 +341,8 @@ class Connection { } else { return socket->read_exactly(DATA_SIZE * sizeof(uint64_t) ).then([this](auto buf) { - auto read_data = reinterpret_cast(buf.get()); + uint64_t read_data[DATA_SIZE]; + std::memcpy(read_data, buf.get(), DATA_SIZE * sizeof(uint64_t)); verify_data_read(read_data); }); } -- 2.39.5