summaryrefslogtreecommitdiff
path: root/paste/httpserver.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2007-06-28 15:50:25 +0000
committerianb <devnull@localhost>2007-06-28 15:50:25 +0000
commita4c4484fd47adf05b2b467bc16bfa00a41381e61 (patch)
treed419da7171c457dcdf20cd8acffcb60640d75f5c /paste/httpserver.py
parent318d1eeb60c903ecc973d3efe96adff03c6ce00d (diff)
downloadpaste-a4c4484fd47adf05b2b467bc16bfa00a41381e61.tar.gz
Don't read past the end of the line with LimitedLengthFile.readline (from Michael van Tellingen)
Diffstat (limited to 'paste/httpserver.py')
-rwxr-xr-xpaste/httpserver.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py
index ec342e6..6838d94 100755
--- a/paste/httpserver.py
+++ b/paste/httpserver.py
@@ -456,9 +456,7 @@ class LimitedLengthFile(object):
return data
def readline(self, *args):
- # @@: I can't see any way to keep this from reading past the end
- # except to implement readline and a buffer privately
- data = self.file.readline(*args)
+ data = self.file.readline(self.length - self._consumed)
self._consumed += len(data)
return data