[Mono-bugs] [Bug 76374][Nor] New - Binary.PeekChar Bug
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Oct 8 12:51:02 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by gonzaloantonio at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76374
--- shadow/76374 2005-10-08 12:51:02.000000000 -0400
+++ shadow/76374.tmp.8278 2005-10-08 12:51:02.000000000 -0400
@@ -0,0 +1,67 @@
+Bug#: 76374
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: gonzaloantonio at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Binary.PeekChar Bug
+
+Description of Problem:
+
+An error ocurred in BinaryReader.PeekChar () method when execute the next code:
+
+using System;
+using System.IO;
+
+class Foo
+{
+ static void Main ()
+ {
+ BinaryReader reader = new BinaryReader (new
+StreamReader("dsc00490.jpg").BaseStream);
+
+ while (reader.PeekChar() != -1) {
+ byte[] peek = reader.ReadBytes (256);
+ }
+ }
+}
+
+Steps to reproduce the problem:
+
+1. Compile code above.
+2. Run program.
+
+Actual Results:
+
+The stack trace stops with the output:
+
+Unhandled Exception: System.ArgumentException: Arg_InsufficientSpace
+Parameter name: chars
+in <0x007af> System.Text.UTF8Encoding:InternalGetChars (System.Byte[]
+bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32
+charIndex, System.UInt32 leftOverBits, System.UInt32 leftOverCount, Boolean
+throwOnInvalid, Boolean flush)
+in <0x00047> System.Text.UTF8Encoding:GetChars (System.Byte[] bytes, Int32
+byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex)
+in <0x00095> System.IO.BinaryReader:ReadCharBytes (System.Char[] buffer,
+Int32 index, Int32 count, System.Byte[] bytes, System.Int32 bytes_read)
+in <0x000a8> System.IO.BinaryReader:PeekChar ()
+in <0x0006d> Foo:Main ()
+
+Expected Results:
+
+finished successfully.
+
+How often does this happen?
+
+any time.
More information about the mono-bugs
mailing list