diff options
author | Charles-François Natali <neologix@free.fr> | 2012-02-18 13:15:38 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2012-02-18 13:15:38 (GMT) |
commit | 66f3cc6f8de83c447d937160e4a1630c4482b5f5 (patch) | |
tree | dbe098ca2acbcbdcdd4fd7dc2c7394dbf46c6037 /Lib/SimpleXMLRPCServer.py | |
parent | d358e0554bc520768041652676ec8e6076f221a9 (diff) | |
download | cpython-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.py | 5 |
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) |