From f20b1164663e69d2a9b02093f5c4e9fea3aeea21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 1 Dec 2008 13:20:36 +0100 Subject: [PATCH] Improve security on pysocket by checking the size --- trytond/pysocket.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trytond/pysocket.py b/trytond/pysocket.py index 8018479e78..1e2b6cdfad 100644 --- a/trytond/pysocket.py +++ b/trytond/pysocket.py @@ -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)