diff options
author | John Salem <josalem@microsoft.com> | 2020-02-12 18:14:46 -0800 |
---|---|---|
committer | Hyungju Lee <leee.lee@samsung.com> | 2020-10-30 17:51:14 +0900 |
commit | 0418281162777e6ca7b9474070af0a9dce9d796a (patch) | |
tree | ddcc2e3f0fae8caa16e9e55151443fbb085d035d | |
parent | cb22524bdb053fb652085deab60137dacb57f883 (diff) | |
download | coreclr-0418281162777e6ca7b9474070af0a9dce9d796a.tar.gz coreclr-0418281162777e6ca7b9474070af0a9dce9d796a.tar.bz2 coreclr-0418281162777e6ca7b9474070af0a9dce9d796a.zip |
modify integral tryparse to use memcpy (#2295)
-rw-r--r-- | src/vm/diagnosticsprotocol.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/diagnosticsprotocol.h b/src/vm/diagnosticsprotocol.h index 657e669033..4669813acc 100644 --- a/src/vm/diagnosticsprotocol.h +++ b/src/vm/diagnosticsprotocol.h @@ -24,7 +24,7 @@ bool TryParse(uint8_t *&bufferCursor, uint32_t &bufferLen, T &result) if (bufferLen < sizeof(T)) return false; - result = *(reinterpret_cast<T *>(bufferCursor)); + memcpy(&result, bufferCursor, sizeof(T)); bufferCursor += sizeof(T); bufferLen -= sizeof(T); return true; |