From: Jo-Philipp Wich Date: Fri, 28 Mar 2014 16:37:03 +0000 (+0000) Subject: libs/sgi-uhttpd: do not assume env.CONTENT_LENGTH to be a number X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0efb19876b0fe85aabdbb1634c8d5001e2cd2c65;p=oweals%2Fluci.git libs/sgi-uhttpd: do not assume env.CONTENT_LENGTH to be a number env.CONTENT_LENGTH as passed by uhttpd might be a string, so explicitely convert it using tonumber(). Issue has been reported by Catalin Patulea Signed-off-by: Jo-Philipp Wich --- diff --git a/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua b/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua index 5915b6980..bca874e46 100644 --- a/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua +++ b/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua @@ -43,7 +43,7 @@ function handle_request(env) renv["HTTP_" .. k] = v end - local len = env.CONTENT_LENGTH or 0 + local len = tonumber(env.CONTENT_LENGTH) or 0 local function recv() if len > 0 then local rlen, rbuf = uhttpd.recv(4096)