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:
d9baf06
)
Remove an unsafe memory write in HeapFree
author
John Chen
<jochen@microsoft.com>
Fri, 13 Nov 2015 21:49:43 +0000
(13:49 -0800)
committer
John Chen
<jochen@microsoft.com>
Fri, 13 Nov 2015 21:49:43 +0000
(13:49 -0800)
The PAL implementation of HeapFree assumes that the memory region always
have at least 4 bytes. Depending on the heap implementation, this is not
necessarily true, and can potentially cause memory corruption.
src/pal/src/memory/heap.cpp
patch
|
blob
|
history
diff --git
a/src/pal/src/memory/heap.cpp
b/src/pal/src/memory/heap.cpp
index
ff1f2a2
..
732fe9a
100644
(file)
--- a/
src/pal/src/memory/heap.cpp
+++ b/
src/pal/src/memory/heap.cpp
@@
-309,8
+309,6
@@
HeapFree(
goto done;
}
- *((DWORD *) lpMem) = 0;
-
bRetVal = TRUE;
#ifdef __APPLE__
// This is patterned off of InternalFree in malloc.cpp.