summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/http
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-06-15 21:43:32 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-06-15 21:43:32 +0000
commit77da39e7762f7494399e7bad88709764cd6d8f44 (patch)
tree67511c8b1debac2bf1503ce8011a3e6e1ff54aa6 /libs/web/luasrc/http
parent15fbb8799eb8830737f7410046fe30ae90d5584d (diff)
* luci/libs: http.protocol: prevent oversized read blocks when reading from socket or file handle
Diffstat (limited to 'libs/web/luasrc/http')
-rw-r--r--libs/web/luasrc/http/protocol.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/web/luasrc/http/protocol.lua b/libs/web/luasrc/http/protocol.lua
index b0074b9e3..970983d5b 100644
--- a/libs/web/luasrc/http/protocol.lua
+++ b/libs/web/luasrc/http/protocol.lua
@@ -520,9 +520,9 @@ function _linereader( obj, bufsz )
elseif type(obj) == "userdata" and ( type(obj.receive) == "function" or type(obj.read) == "function" ) then
if type(obj.read) == "function" then
- __read = function() return obj:read( bufsz ) end
+ __read = function() return obj:read( bufsz - #_buf ) end
else
- __read = function() return obj:receive( bufsz ) end
+ __read = function() return obj:receive( bufsz - #_buf ) end
end
-- object is a function