summaryrefslogtreecommitdiffstats
path: root/Lib/SimpleXMLRPCServer.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2012-02-18 13:15:38 (GMT)
committerCharles-François Natali <neologix@free.fr>2012-02-18 13:15:38 (GMT)
commit66f3cc6f8de83c447d937160e4a1630c4482b5f5 (patch)
treedbe098ca2acbcbdcdd4fd7dc2c7394dbf46c6037 /Lib/SimpleXMLRPCServer.py
parentd358e0554bc520768041652676ec8e6076f221a9 (diff)
downloadcpython-66f3cc6f8de83c447d937160e4a1630c4482b5f5.zip
cpython-66f3cc6f8de83c447d937160e4a1630c4482b5f5.tar.gz
cpython-66f3cc6f8de83c447d937160e4a1630c4482b5f5.tar.bz2
Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in SimpleXMLRPCServer
upon malformed POST request.
Diffstat (limited to 'Lib/SimpleXMLRPCServer.py')
-rw-r--r--Lib/SimpleXMLRPCServer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py
index 6af2f2f..23ad5bd 100644
--- a/Lib/SimpleXMLRPCServer.py
+++ b/Lib/SimpleXMLRPCServer.py
@@ -459,7 +459,10 @@ class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
L = []
while size_remaining:
chunk_size = min(size_remaining, max_chunk_size)
- L.append(self.rfile.read(chunk_size))
+ chunk = self.rfile.read(chunk_size)
+ if not chunk:
+ break
+ L.append(chunk)
size_remaining -= len(L[-1])
data = ''.join(L)