This ensures that even if some wonky string encoding is passed as the body of a HTTP reply, it will be treated as binary. Fixes some of the HTTP Server exploits on Windows

git-svn-id: file:///home/svn/framework3/trunk@10653 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2010-10-12 16:16:39 +00:00
parent 213b188fdb
commit dbbd0dc07e
1 changed files with 3 additions and 1 deletions

View File

@ -165,7 +165,9 @@ class Packet
# Converts the packet to a string. # Converts the packet to a string.
# #
def to_s def to_s
content = self.body.dup # Duplicate and make sure this is 8BIT safe for Ruby 1.9
content = self.body.unpack("C*").pack("C*")
# Update the content length field in the header with the body length. # Update the content length field in the header with the body length.
if (content) if (content)
if !self.compress.nil? if !self.compress.nil?