aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/cgi.rb3
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 78079570ea..61d59c5e00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul 26 16:06:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): check
+ multipart boundary end. a patch from Fujioka <fuj at rabbix.jp>
+ [ruby-dev:28470]
+
Wed Jul 26 01:02:59 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: suppress warnings by automake 1.8 or later.
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 04f0b5e7ce..4308efcb6b 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -981,6 +981,7 @@ class CGI
boundary = "--" + boundary
buf = ""
bufsize = 10 * 1024
+ boundary_end=""
# start multipart/form-data
stdinput.binmode if defined? stdinput.binmode
@@ -1028,6 +1029,7 @@ class CGI
if "--" == $2
content_length = -1
end
+ boundary_end = $2.dup
""
end
@@ -1062,6 +1064,7 @@ class CGI
break if buf.size == 0
break if content_length === -1
end
+ raise EOFError, "bad boundary end of body part" unless boundary_end=~/--/
params
end # read_multipart