Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > ea9ea0dfbc4fc3f0d4c076035aa0c3b5 > files > 4

ruby-1.8.6.420-2.fc13.src.rpm

--- lib/cgi.rb  (revision 19665)
+++ lib/cgi.rb  (working copy)
@@ -546,6 +546,11 @@
     when Hash
       options = options.dup
     end
+    options.each_value do |value|
+      if /\n(?![ \t])/ === value
+        raise ArgumentError, "potential HTTP header injection detected"
+      end
+    end

     unless options.has_key?("type")
       options["type"] = "text/html"