commit | dd529367052d2d4e723407525887310fe866ddd8 | [log] [tgz] |
---|---|---|
author | Drew Fisher <zarvox@google.com> | Wed Dec 09 17:26:00 2020 -0800 |
committer | Drew Fisher <zarvox@google.com> | Wed Dec 09 17:27:26 2020 -0800 |
tree | 197abc7ea4addecf84f01408d7b747f37c8c54cf | |
parent | 51f6971f5f06ec101e5fbcabe5a49477708540f3 [diff] |
Fix undefined behavior (unaligned write) in protocol.cc Change-Id: Ia7cf7734e534bfeef689e54c56d95d0d5cab2584
diff --git a/protocol.cc b/protocol.cc index 744dc04..c70e940 100644 --- a/protocol.cc +++ b/protocol.cc
@@ -163,7 +163,7 @@ len != sizeof(T)) { return false; } - *out_value = *reinterpret_cast<const T *>(data); + memcpy(out_value, data, sizeof(T)); return true; }