Do not attempt to write 0 bytes.
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 27 Apr 2012 19:43:52 +0000 (15:43 -0400)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 27 Apr 2012 19:43:52 +0000 (15:43 -0400)
Fixes bug #4669.

mcs/class/System/System.Net/ChunkStream.cs

index 2c29b417c9cfb6bd1f3739016131a3b6e5221093..b3888fb1581c24f417e505c54c4423411b41c185 100644 (file)
@@ -130,7 +130,8 @@ namespace System.Net
                
                public void Write (byte [] buffer, int offset, int size)
                {
-                       InternalWrite (buffer, ref offset, size);
+                       if (offset < size)
+                               InternalWrite (buffer, ref offset, size);
                }
                
                void InternalWrite (byte [] buffer, ref int offset, int size)