[Mono-bugs] [Bug 62048][Nor] Changed - XmlSerializer crashes on Deserialize from MemoryStream

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 28 Jul 2004 12:25:31 -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 lluis@ximian.com.

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

--- shadow/62048	2004-07-28 11:06:02.000000000 -0400
+++ shadow/62048.tmp.11467	2004-07-28 12:25:31.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 62048
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
-Resolution: 
-Severity: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
 Priority: Normal
 Component: Sys.XML
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: monobugs@radeldudel.de               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -88,6 +88,19 @@
 System.Reflection.MonoMethod:InternalInvoke (object,object[])
 	in <0x00004> (wrapper managed-to-native) 
 System.Reflection.MonoMethod:InternalInvoke (object,object[])
 	in <0x0008e> System.Reflection.MonoMethod:Invoke 
 (object,System.Reflection.BindingFlags,System.Reflection.Binder,object
 [],System.Globalization.CultureInfo)
+
+------- Additional Comments From lluis@ximian.com  2004-07-28 12:25 -------
+You should not use GetBuffer() to get the bytes from the MemoryStream,
+you should use ToArray() instead. GetBuffer() returns the internal
+buffer, which can have more bytes that the actually writen.
+
+The test case is crashing in Mono because the serializer finds several
+null chars at the end of the stream and can't deal with this. I've
+fixed the XmlTextReader so it stops parsing when it finds a null char,
+and now the test case works.
+
+The fix is commited in the 1.0 CVS branch and in the HEAD branch, so
+it will be available in Mono 1.0.1 and Mono 1.1.