Improve security on pysocket by checking the size
This commit is contained in:
1 parent
afe4768117
commit
f20b116466
1 file changed
+2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user