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:
f06fa2e
)
Add check for out of memory
author
DionYe
<junye@microsoft.com>
Fri, 15 Jan 2016 03:32:01 +0000
(11:32 +0800)
committer
DionYe
<junye@microsoft.com>
Mon, 18 Jan 2016 02:44:22 +0000
(10:44 +0800)
src/mscorlib/src/System/StubHelpers.cs
patch
|
blob
|
history
diff --git
a/src/mscorlib/src/System/StubHelpers.cs
b/src/mscorlib/src/System/StubHelpers.cs
index
699662b
..
a78a158
100644
(file)
--- a/
src/mscorlib/src/System/StubHelpers.cs
+++ b/
src/mscorlib/src/System/StubHelpers.cs
@@
-173,6
+173,11
@@
namespace System.StubHelpers {
// If not provided, allocate the buffer using SysAllocStringByteLen so
// that odd-sized strings will be handled as well.
ptrToFirstChar = (byte *)Win32Native.SysAllocStringByteLen(null, lengthInBytes).ToPointer();
+
+ if (ptrToFirstChar == null)
+ {
+ throw new OutOfMemoryException();
+ }
}
// copy characters from the managed string