projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb22524
)
modify integral tryparse to use memcpy (#2295)
author
John Salem
<josalem@microsoft.com>
Thu, 13 Feb 2020 02:14:46 +0000
(18:14 -0800)
committer
Hyungju Lee
<leee.lee@samsung.com>
Fri, 30 Oct 2020 08:51:14 +0000
(17:51 +0900)
src/vm/diagnosticsprotocol.h
patch
|
blob
|
history
diff --git
a/src/vm/diagnosticsprotocol.h
b/src/vm/diagnosticsprotocol.h
index
657e669
..
4669813
100644
(file)
--- 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;