[Mono-bugs] [Bug 77550][Maj] New - UTF8Encoding fails on invalid UTF8

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Feb 14 04:39:57 EST 2006


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 pawel.sakowski at mind-breeze.com.

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

--- shadow/77550	2006-02-14 04:39:57.000000000 -0500
+++ shadow/77550.tmp.26989	2006-02-14 04:39:57.000000000 -0500
@@ -0,0 +1,69 @@
+Bug#: 77550
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: pawel.sakowski at mind-breeze.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: UTF8Encoding fails on invalid UTF8
+
+Description of Problem:
+The NET_2_0 variant of UTF8Encoding crashes when passed certain non-valid
+UTF-8 sequences.
+
+Steps to reproduce the problem:
+Compile with gmcs:
+1. new UTF8Encoding(false,false).GetDecoder().GetCharCount(new
+byte[]{(byte) 183},0,1)
+2. new UTF8Encoding(false,false).GetDecoder().GetChars(new byte[]{(byte)
+183},0,1,new char[100],0)
+3. new UTF8Encoding(false,false).GetString(new byte[]{(byte) 183})
+
+Actual Results:
+1. Unhandled Exception: System.ArgumentOutOfRangeException: Argument is out
+of range.
+Parameter name: index
+in <0x000fd> System.Text.DecoderReplacementFallbackBuffer:Fallback
+(System.Byte[] bytesUnknown, Int32 index)
+in <0x0009d> System.Text.UTF8Encoding:Fallback (System.Object provider,
+System.Text.DecoderFallbackBuffer buffer, System.Byte[] bytes, Int32 index)
+in <0x001b9> System.Text.UTF8Encoding:InternalGetCharCount (System.Byte[]
+bytes, Int32 index, Int32 count, UInt32 leftOverBits, UInt32 leftOverCount,
+System.Object provider, System.Text.DecoderFallbackBuffer fallbackBuffer,
+Boolean flush)
+in <0x00036> System.Text.UTF8Encoding+UTF8Decoder:GetCharCount
+(System.Byte[] bytes, Int32 index, Int32 count)
+in <0x00057> Test:Main ()
+
+2.  Unhandled Exception: System.ArgumentOutOfRangeException: Argument is
+out of range.
+Parameter name: index
+in <0x000fd> System.Text.DecoderReplacementFallbackBuffer:Fallback
+(System.Byte[] bytesUnknown, Int32 index)
+in <0x000ac> System.Text.UTF8Encoding:Fallback (System.Object provider,
+System.Text.DecoderFallbackBuffer buffer, System.Byte[] bytes, Int32
+byteIndex, System.Char[] chars, System.Int32 charIndex)
+in <0x00242> System.Text.UTF8Encoding:InternalGetChars (System.Byte[]
+bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32
+charIndex, System.UInt32 leftOverBits, System.UInt32 leftOverCount,
+System.Object provider, System.Text.DecoderFallbackBuffer fallbackBuffer,
+Boolean flush)
+in <0x00235> System.Text.UTF8Encoding+UTF8Decoder:GetChars (System.Byte[]
+bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex)
+in <0x0006b> Test:Main ()
+3. same exception, similar stack trace
+
+Expected Results:
+All the above calls should return without an exception.
+
+How often does this happen? 
+100%


More information about the mono-bugs mailing list