diff options
author | Charles-François Natali <neologix@free.fr> | 2012-02-18 13:30:34 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2012-02-18 13:30:34 (GMT) |
commit | e062466480c1aa8da6fa16532ec0252988f799ba (patch) | |
tree | 760f5801ea0cfbeb83c3df1bafb90d1bf64a9e39 /Lib/SimpleXMLRPCServer.py | |
parent | c39b552603ef6a5f5c0e5a6d239a2f9021faffcc (diff) | |
parent | 66f3cc6f8de83c447d937160e4a1630c4482b5f5 (diff) | |
download | cpython-e062466480c1aa8da6fa16532ec0252988f799ba.zip cpython-e062466480c1aa8da6fa16532ec0252988f799ba.tar.gz cpython-e062466480c1aa8da6fa16532ec0252988f799ba.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 4cdc154..4fefa5a 100644 --- a/Lib/SimpleXMLRPCServer.py +++ b/Lib/SimpleXMLRPCServer.py @@ -486,7 +486,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) |