summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Salem <josalem@microsoft.com>2020-02-12 18:14:46 -0800
committerHyungju Lee <leee.lee@samsung.com>2020-10-30 17:51:14 +0900
commit0418281162777e6ca7b9474070af0a9dce9d796a (patch)
treeddcc2e3f0fae8caa16e9e55151443fbb085d035d
parentcb22524bdb053fb652085deab60137dacb57f883 (diff)
downloadcoreclr-0418281162777e6ca7b9474070af0a9dce9d796a.tar.gz
coreclr-0418281162777e6ca7b9474070af0a9dce9d796a.tar.bz2
coreclr-0418281162777e6ca7b9474070af0a9dce9d796a.zip
modify integral tryparse to use memcpy (#2295)
-rw-r--r--src/vm/diagnosticsprotocol.h2
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;