[Mono-bugs] [Bug 59648][Maj] Changed - UTF8Encoding.GetChars() fils for some byte data

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 7 Jun 2004 05:53:27 -0400 (EDT)


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 atsushi@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=59648

--- shadow/59648	2004-06-07 01:02:28.000000000 -0400
+++ shadow/59648.tmp.9782	2004-06-07 05:53:27.000000000 -0400
@@ -46,6 +46,22 @@
 
 Expected Results:
 It successfully runs under MS.NET
 
 How often does this happen? 
 always
+
+------- Additional Comments From atsushi@ximian.com  2004-06-07 05:53 -------
+Can't we just /ignore those overlongs?
+
+It might be used like this way (as we talked on irc):
+
+BinaryReader br = new BinaryReader (stream);
+while (br.PeekChar ())
+  br.ReadInt32 ();
+
+Note that PeekChar () tries to read one utf-8 character.
+
+Currently the code above will "randomly" crashes (well, not random,
+but users might guess so) when PeekChar() met overlong binary data.
+
+Attaching the patch.