Improve security on pysocket by checking the size

This commit is contained in:
Cédric Krier committed 2008-12-01 13:20:36 +01:00
1 parent afe4768117
commit f20b116466
1 file changed
+2
+2
View File
@@ -142,6 +142,8 @@ class PySocket:
break
size, msg = buf.split(' ', 1)
size = int(size)
if size > MAX_SIZE:
raise RuntimeError, "socket connection broken"
if msg == '':
if self.ssl:
msg = self.ssl_sock.read(4096)