From 0ab37e1f493c792e7c21086116adff1a63bf3ff8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Nov 2009 23:02:02 -0800 Subject: tee_input: do not clobber trailer buffer on partial uploads Found in Rainbows! testing. Reusing the buffer when finalizing input for headers could be problematic because it would lead to the @buf2 instance variable being clobbered; allowing the trailers to "leak" into the body. --- lib/unicorn/tee_input.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb index 7e77cdf..b66dce0 100644 --- a/lib/unicorn/tee_input.rb +++ b/lib/unicorn/tee_input.rb @@ -142,7 +142,7 @@ module Unicorn def finalize_input while parser.trailers(req, buf).nil? - buf << socket.readpartial(Const::CHUNK_SIZE, @buf2) + buf << socket.readpartial(Const::CHUNK_SIZE) end self.socket = nil end -- cgit v1.2.3-24-ge0c7