[Mono-bugs] [Bug 62388][Cri] New - BitConverter.ToString(byte[]) works improperly with zero-length arrays

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 3 Aug 2004 18:09:55 -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 info@x-tensive.com.

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

--- shadow/62388	2004-08-03 18:09:55.000000000 -0400
+++ shadow/62388.tmp.15550	2004-08-03 18:09:55.000000000 -0400
@@ -0,0 +1,34 @@
+Bug#: 62388
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: info@x-tensive.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: BitConverter.ToString(byte[]) works improperly with zero-length arrays
+
+BitConverter.ToString(byte[]) works improperly with zero-length arrays.
+
+An example:
+  string result = BitConverter.ToString(new byte[0]);
+
+The following exception throwing:
+
+System.ArgumentOutOfRangeException: Argument is out of range.
+Parameter name: startIndex
+in <0x00092> System.BitConverter:ToString (byte[],int,int)
+in <0x00042> System.BitConverter:ToString (byte[])
+...
+
+Since BitConverter is used in System.Data.SqlClient classes (as far as I 
+remembers, Tds70 or something like this), this bug makes impossible to 
+e.g. pass zero-length byte arrays as query parameters.