Fix possible overflow in SafeBuffer.Initialize.
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Tue, 25 Sep 2018 21:54:26 +0000 (14:54 -0700)
committerJeremy Koritzinsky <jekoritz@microsoft.com>
Tue, 25 Sep 2018 21:54:26 +0000 (14:54 -0700)
commit0c288c367db3dc7c296e67a4bb2fff84f0f93c3f
tree26c3abc162e847f5c6ce6ef353499205849f2b8a
parentbcb2a56138685748c5a8c1d8c973ff1a51c81883
Fix possible overflow in SafeBuffer.Initialize.

Since a 0-length buffer is technically possible (though not very usable), have sizeOfEachElement==0 -> ByteLength == 0.
src/System.Private.CoreLib/shared/System/Runtime/InteropServices/SafeBuffer.cs