]> granicus.if.org Git - python/commitdiff
Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in SimpleXMLRPCServer
authorCharles-François Natali <neologix@free.fr>
Sat, 18 Feb 2012 13:42:57 +0000 (14:42 +0100)
committerCharles-François Natali <neologix@free.fr>
Sat, 18 Feb 2012 13:42:57 +0000 (14:42 +0100)
upon malformed POST request.

Lib/xmlrpc/server.py
Misc/NEWS

index 24d8a6a03e3e7fee030a4ab5d1ef22764941d27f..93df5615068805a620f9385ff83b932e4095927b 100644 (file)
@@ -449,7 +449,10 @@ class SimpleXMLRPCRequestHandler(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 = b''.join(L)
 
index b70b097cb7549516ba047e4bf3e6e797e2eafe28..6e9569733778e115a572270b68c639c8e0d20308 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in
+  SimpleXMLRPCServer upon malformed POST request.
+
 - Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC
   IV attack countermeasure.