diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2009-06-26 18:15:12 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2009-06-26 18:15:12 +0400 |
commit | 922abe10f3619bbf88cc7a1de457da721af615f7 (patch) | |
tree | ef6ba4872cd786099d4f35c57f9d4bf2c8f16e13 /mcs | |
parent | b04ce8e1da596812dd56802ad7cde7abd722d960 (diff) |
2009-06-26 Atsushi Enomoto <atsushi@ximian.com>
* XmlFormatterDeserializer.cs : verifyObjectName rather blocked
correct names provided as the root names.
svn path=/trunk/mcs/; revision=136964
Diffstat (limited to 'mcs')
-rwxr-xr-x | mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog index 5108f0a5e06..eb52ad479a0 100755 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog @@ -1,3 +1,8 @@ +2009-06-26 Atsushi Enomoto <atsushi@ximian.com> + + * XmlFormatterDeserializer.cs : verifyObjectName rather blocked + correct names provided as the root names. + 2009-06-01 Atsushi Enomoto <atsushi@ximian.com> * XmlFormatterSerializer.cs, KnownTypeCollection.cs : collection diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs index 8e45553c7b5..2335b97b7e4 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs @@ -51,11 +51,15 @@ namespace System.Runtime.Serialization public static object Deserialize (XmlReader reader, Type type, KnownTypeCollection knownTypes, IDataContractSurrogate surrogate, - string name, string Namespace, bool verifyObjectName) + string name, string ns, bool verifyObjectName) { - reader.MoveToContent(); + reader.MoveToContent (); if (verifyObjectName) - Verify (knownTypes, type, name, Namespace, reader); + if (reader.NodeType != XmlNodeType.Element || + reader.LocalName != name || + reader.NamespaceURI != ns) + throw new SerializationException (String.Format ("Expected element '{0}' in namespace '{1}', but found {2} node '{3}' in namespace '{4}'", name, ns, reader.NodeType, reader.LocalName, reader.NamespaceURI)); +// Verify (knownTypes, type, name, ns, reader); return new XmlFormatterDeserializer (knownTypes, surrogate).Deserialize (type, reader); } |