Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2009-01-20 13:46:06 +0300
committerAtsushi Eno <atsushieno@gmail.com>2009-01-20 13:46:06 +0300
commit29dd077cdd6236693bd4df628250ec21ec78ffec (patch)
treeca6917ecdc9dec20fb2066069cced1e4f2130553 /mcs/class/System.XML/System.Xml
parentaa2607300a64ccd0fbd153db7ec33556cd712b99 (diff)
2009-01-20 Atsushi Enomoto <atsushi@ximian.com>
* XmlDocumentNavigator.cs : in some corner cases an attribute may have null OwnerElement. Fixed bug #458245. * SelectNodesTests.cs : added test for bug #458245. svn path=/trunk/mcs/; revision=123868
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs2
2 files changed, 7 insertions, 0 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 679491f0ba1..3807976d01f 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,5 +1,10 @@
2009-01-20 Atsushi Enomoto <atsushi@ximian.com>
+ * XmlDocumentNavigator.cs : in some corner cases an attribute
+ may have null OwnerElement. Fixed bug #458245.
+
+2009-01-20 Atsushi Enomoto <atsushi@ximian.com>
+
* XmlReaderBinarySupport.cs : do not hang in the middle of reading
byte chunk at some node types. Fixed bug #464229.
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs b/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
index 6a8e78ccf04..885cdd08ec4 100644
--- a/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
+++ b/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
@@ -628,6 +628,8 @@ namespace System.Xml
{
XmlAttribute attr = node as XmlAttribute;
XmlNode tmp = attr != null ? attr.OwnerElement : node;
+ if (tmp == null)
+ return; // i.e. attr has null OwnerElement.
for (XmlNode tmp2 = GetParentNode (tmp); tmp2 != null; tmp2 = GetParentNode (tmp2))
tmp = tmp2;
node = tmp;