commit | baab7325e25139ea9b8c00242c3912ef61a1416e | [log] [tgz] |
---|---|---|
author | Junxiao Shi <git@mail1.yoursunny.com> | Thu Jul 27 01:22:49 2017 +0000 |
committer | Alex Afanasyev <aa@cs.ucla.edu> | Thu Jul 27 10:30:10 2017 -0700 |
tree | 6aebcb49e9696ef322a3742893dc3766cc15d293 | |
parent | d701e5bebcb62c0655194d08c81700b98a8df3ce [diff] [blame] |
tests: avoid misaligned memory access in InMemoryStorage test refs #4191 Change-Id: I2b5255c70e07a36fdd6601f24e4468e3d8c00346
diff --git a/tests/unit-tests/ims/in-memory-storage.t.cpp b/tests/unit-tests/ims/in-memory-storage.t.cpp index 41082c6..3689c53 100644 --- a/tests/unit-tests/ims/in-memory-storage.t.cpp +++ b/tests/unit-tests/ims/in-memory-storage.t.cpp
@@ -733,7 +733,9 @@ if (content.value_size() != sizeof(uint32_t)) { return 0; } - return *reinterpret_cast<const uint32_t*>(content.value()); + uint32_t id = 0; + std::memcpy(&id, content.value(), sizeof(id)); + return id; } protected: