Author: atsushi
Date: 2006-12-11 22:13:15 -0500 (Mon, 11 Dec 2006)
New Revision: 69382
Modified:
trunk/mcs/class/System.XML/System.Xml/ChangeLog
trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs
trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
trunk/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
Log:
2006-12-12 Atsushi Enomoto <[EMAIL PROTECTED]>
* DTDValidatingReader2.cs : when an attribute declaration is missing
in the corresponding attlist declaration, it caused NRE.
Fixed bug #80231.
* XmlValidatingReaderTests.cs : added test for bug #80231.
Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog 2006-12-12 00:57:16 UTC
(rev 69381)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog 2006-12-12 03:13:15 UTC
(rev 69382)
@@ -1,3 +1,9 @@
+2006-12-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * DTDValidatingReader2.cs : when an attribute declaration is missing
+ in the corresponding attlist declaration, it caused NRE.
+ Fixed bug #80231.
+
2006-12-11 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlDocument.cs : call overriden CreateAttribute() when loading from
Modified: trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs
2006-12-12 00:57:16 UTC (rev 69381)
+++ trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs
2006-12-12 03:13:15 UTC (rev 69382)
@@ -1190,7 +1190,7 @@
valueBuilder.Replace ('\n', ' ');
valueBuilder.Replace ('\t', ' ');
try {
- if (def.Datatype.TokenizedType ==
XmlTokenizedType.CDATA)
+ if (def == null || def.Datatype.TokenizedType
== XmlTokenizedType.CDATA)
return valueBuilder.ToString ();
for (int i=0; i < valueBuilder.Length; i++) {
if (valueBuilder [i] != ' ')
Modified: trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog 2006-12-12
00:57:16 UTC (rev 69381)
+++ trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog 2006-12-12
03:13:15 UTC (rev 69382)
@@ -1,3 +1,7 @@
+2006-12-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * XmlValidatingReaderTests.cs : added test for bug #80231.
+
2006-12-11 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlDocumentTests.cs : make sure to call overriden CreateAttribute()
Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
2006-12-12 00:57:16 UTC (rev 69381)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
2006-12-12 03:13:15 UTC (rev 69382)
@@ -920,5 +920,18 @@
AssertEquals ("#8-1", null, xvr.LookupNamespace
(String.Empty));
AssertEquals ("#8-2", "urn:hoge", xvr.LookupNamespace
("bar"));
}
+
+ [Test]
+ [ExpectedException (typeof (XmlSchemaException))]
+ public void Bug80231 ()
+ {
+ string xml = "<!DOCTYPE file [<!ELEMENT file
EMPTY><!ATTLIST file name CDATA #REQUIRED>]><file name=\"foo\" bar=\"baz\" />";
+ XmlReaderSettings settings = new XmlReaderSettings ();
+ settings.ProhibitDtd = false;
+ settings.ValidationType = ValidationType.DTD;
+ XmlReader r = XmlReader.Create (new StringReader (xml),
settings);
+ while (!r.EOF)
+ r.Read ();
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches