[Mono-bugs] [Bug 79468][Nor] New - XmlDocument.GetElementsByTagName results in ArgumentOutOfRangeException
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Sep 21 23:46:16 EDT 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 gert.driesen at pandora.be.
http://bugzilla.ximian.com/show_bug.cgi?id=79468
--- shadow/79468 2006-09-21 23:46:16.000000000 -0400
+++ shadow/79468.tmp.14364 2006-09-21 23:46:16.000000000 -0400
@@ -0,0 +1,62 @@
+Bug#: 79468
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com
+ReportedBy: gert.driesen at pandora.be
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: XmlDocument.GetElementsByTagName results in ArgumentOutOfRangeException
+
+Calling XmlDocument.GetElementsByTagName results in the following
+exception:
+
+Unhandled Exception: System.ArgumentOutOfRangeException: Argument is out
+of range.
+Parameter name: destinationIndex + count > destination.Length
+ at System.String.CopyTo (Int32 sourceIndex, System.Char[] destination,
+Int32 destinationIndex, Int32 count) [0x00000]
+ at System.Xml.XmlNameEntryCache.GetAtomizedPrefixedName (System.String
+prefix, System.String local) [0x00000]
+ at System.Xml.XmlNameEntry.GetPrefixedName
+(System.Xml.XmlNameEntryCache owner) [0x00000]
+ at System.Xml.XmlElement.get_Name () [0x00000]
+ at System.Xml.XmlNode.SearchDescendantElements (System.String name,
+Boolean matchAll, System.Collections.ArrayList list) [0x00000]
+ at System.Xml.XmlDocument.GetElementsByTagName (System.String name)
+[0x00000]
+ at Test.Main (System.String[] args) [0x00000]
+
+To reproduce, compile and run the following code snippet:
+
+using System;
+using System.IO;
+using System.Xml;
+
+public class Test
+{
+ static int Main (String [] args)
+ {
+ XmlDocument doc = new XmlDocument ();
+ doc.LoadXml (_xml);
+ XmlNodeList nodeList = doc.GetElementsByTagName ("Signature");
+ if (nodeList.Count != 1) {
+ Console.WriteLine ("FAILURE");
+ return 1;
+ }
+ return 0;
+ }
+
+ private const string _xml = "<?xml version='1.0' encoding='UTF-8'?>"
+ + "<ns0:DebtAmountRequest xmlns:ns0='http://whatever'>"
+ + " <Signature xmlns='http://www.w3.org/2000/09/xmldsig#' />"
+ + "</ns0:DebtAmountRequest>";
+}
More information about the mono-bugs
mailing list