summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpclib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-04 08:28:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-04 08:28:09 (GMT)
commit073418af05eca9a1747b9a89814285907b92a671 (patch)
tree95c4817fc5c7f79f1220e3df419f65bc2c521dd8 /Lib/xmlrpclib.py
parent7dc8e1e95e24bdd77bd40828abeb181fd411bec3 (diff)
downloadcpython-073418af05eca9a1747b9a89814285907b92a671.zip
cpython-073418af05eca9a1747b9a89814285907b92a671.tar.gz
cpython-073418af05eca9a1747b9a89814285907b92a671.tar.bz2
Issue #26873: xmlrpclib now raises ResponseError on unsupported type tags
instead of silently return incorrect result.
Diffstat (limited to 'Lib/xmlrpclib.py')
-rw-r--r--Lib/xmlrpclib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py
index 3a2c0bf..e072f71 100644
--- a/Lib/xmlrpclib.py
+++ b/Lib/xmlrpclib.py
@@ -784,6 +784,7 @@ class Unmarshaller:
self._stack = []
self._marks = []
self._data = []
+ self._value = False
self._methodname = None
self._encoding = "utf-8"
self.append = self._stack.append
@@ -814,6 +815,8 @@ class Unmarshaller:
if tag == "array" or tag == "struct":
self._marks.append(len(self._stack))
self._data = []
+ if self._value and tag not in self.dispatch:
+ raise ResponseError("unknown tag %r" % tag)
self._value = (tag == "value")
def data(self, text):