Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Maurer <benm@mono-cvs.ximian.com>2003-11-15 06:48:24 +0300
committerBen Maurer <benm@mono-cvs.ximian.com>2003-11-15 06:48:24 +0300
commit3881e093205f2fe12f9646ddbfa34c6a3eec1ab9 (patch)
tree4e47e44771542481e7845f180fd02a7bbf11b3f5 /mcs/class/corlib/System.IO/MemoryStream.cs
parent51bc7806158facb0027f10417bd2415a16b770fd (diff)
2003-11-14 Ben Maurer <bmaurer@users.sourceforge.net>
* MemoryStream.cs (.ctor): We need to check if buffer is null before we get the Length of it. svn path=/trunk/mcs/; revision=20016
Diffstat (limited to 'mcs/class/corlib/System.IO/MemoryStream.cs')
-rw-r--r--mcs/class/corlib/System.IO/MemoryStream.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.IO/MemoryStream.cs b/mcs/class/corlib/System.IO/MemoryStream.cs
index 39d0df14245..c7f2e3f12b8 100644
--- a/mcs/class/corlib/System.IO/MemoryStream.cs
+++ b/mcs/class/corlib/System.IO/MemoryStream.cs
@@ -46,11 +46,17 @@ namespace System.IO
public MemoryStream (byte [] buffer)
{
+ if (buffer == null)
+ throw new ArgumentNullException ("buffer");
+
InternalConstructor (buffer, 0, buffer.Length, true, false);
}
public MemoryStream (byte [] buffer, bool writeable)
{
+ if (buffer == null)
+ throw new ArgumentNullException ("buffer");
+
InternalConstructor (buffer, 0, buffer.Length, writeable, false);
}