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:35:44 +0300
committerAtsushi Eno <atsushieno@gmail.com>2009-01-20 13:35:44 +0300
commitaa2607300a64ccd0fbd153db7ec33556cd712b99 (patch)
tree26bab2fc45d69905823c1e149f09ba38f258d0a6 /mcs/class/System.XML/System.Xml
parent2279cf0cf80de4ba6ca877a1daa1126dfcf587b2 (diff)
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. * XmlReaderCommonTests.cs : added test for bug #464229. svn path=/trunk/mcs/; revision=123866
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/XmlReaderBinarySupport.cs11
2 files changed, 12 insertions, 4 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 99da56b3654..679491f0ba1 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2009-01-14 Sebastien Pouliot <sebastien@ximian.com>
* NamespaceHandling.cs: New. Enum for Silverlight 2. Microsoft's
diff --git a/mcs/class/System.XML/System.Xml/XmlReaderBinarySupport.cs b/mcs/class/System.XML/System.Xml/XmlReaderBinarySupport.cs
index 95894daed81..9820cfd6ef4 100644
--- a/mcs/class/System.XML/System.Xml/XmlReaderBinarySupport.cs
+++ b/mcs/class/System.XML/System.Xml/XmlReaderBinarySupport.cs
@@ -354,8 +354,8 @@ namespace System.Xml
return 0;
}
- bool consumeToEnd = false;
- while (!consumeToEnd && textCache.Length < length) {
+ bool loop = true;
+ while (loop && textCache.Length < length) {
switch (reader.NodeType) {
case XmlNodeType.Text:
case XmlNodeType.CDATA:
@@ -370,13 +370,16 @@ namespace System.Xml
Read ();
break;
default:
- consumeToEnd = true;
+ loop = false;
break;
}
}
textCache.Append (reader.Value);
hasCache = true;
break;
+ default:
+ loop = false;
+ break;
}
}
state = backup;
@@ -386,7 +389,7 @@ namespace System.Xml
string str = textCache.ToString (0, min);
textCache.Remove (0, str.Length);
str.CopyTo (0, buffer, offset, str.Length);
- if (min < length)
+ if (min < length && loop)
return min + ReadValueChunk (buffer, offset + min, length - min);
else
return min;