aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorsimon <simon@FreeBSD.org>2004-11-25 23:25:33 +0800
committersimon <simon@FreeBSD.org>2004-11-25 23:25:33 +0800
commit76b1b828508de9669c518f9e77bf57108ab8f1e4 (patch)
treea836d085956375c63448fbb356e54bb604e8f3ea /lang
parent5ef486743c588ee06e20a4ddb1c9f101299a1c44 (diff)
downloadfreebsd-ports-gnome-76b1b828508de9669c518f9e77bf57108ab8f1e4.tar.gz
freebsd-ports-gnome-76b1b828508de9669c518f9e77bf57108ab8f1e4.tar.zst
freebsd-ports-gnome-76b1b828508de9669c518f9e77bf57108ab8f1e4.zip
Fix DoS in the Ruby CGI module.
Obtained from: ruby CVS Reviewed by: trhodes OK'ed by: maintainer silence With hat: secteam
Diffstat (limited to 'lang')
-rw-r--r--lang/ruby16/Makefile1
-rw-r--r--lang/ruby16/files/patch-cgi.rb30
-rw-r--r--lang/ruby18/Makefile2
-rw-r--r--lang/ruby18/files/patch-cgi.rb27
4 files changed, 59 insertions, 1 deletions
diff --git a/lang/ruby16/Makefile b/lang/ruby16/Makefile
index faaa12e4c351..884e968e1b09 100644
--- a/lang/ruby16/Makefile
+++ b/lang/ruby16/Makefile
@@ -7,6 +7,7 @@
PORTNAME= ruby${RUBY_R}
PORTVERSION= ${RUBY_PORTVERSION}
+PORTREVISION= 1
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= ${MASTER_SITE_SUBDIR_RUBY}
diff --git a/lang/ruby16/files/patch-cgi.rb b/lang/ruby16/files/patch-cgi.rb
new file mode 100644
index 000000000000..d84b3c23e74a
--- /dev/null
+++ b/lang/ruby16/files/patch-cgi.rb
@@ -0,0 +1,30 @@
+--- lib/cgi.rb 2002/08/25 20:15:54 1.23.2.17
++++ lib/cgi.rb 2004/10/24 23:37:19 1.23.2.18
+@@ -182,7 +182,7 @@ class CGI
+ CR = "\015"
+ LF = "\012"
+ EOL = CR + LF
+- REVISION = '$Id: cgi.rb,v 1.23.2.17 2002/08/25 20:15:54 wakou Exp $'
++ REVISION = '$Id: cgi.rb,v 1.23.2.18 2004/10/24 23:37:19 matz Exp $'
+
+ NEEDS_BINMODE = true if /WIN/ni.match(RUBY_PLATFORM)
+ PATH_SEPARATOR = {'UNIX'=>'/', 'WINDOWS'=>'\\', 'MACINTOSH'=>':'}
+@@ -823,13 +823,15 @@ def read_multipart(boundary, content
+ end
+
+ c = if bufsize < content_length
+- stdinput.read(bufsize) or ''
++ stdinput.read(bufsize)
+ else
+- stdinput.read(content_length) or ''
++ stdinput.read(content_length)
+ end
++ if c.nil?
++ raise EOFError, "bad content body"
++ end
+ buf += c
+ content_length -= c.size
+-
+ end
+
+ buf = buf.sub(/\A((?:.|\n)*?)(?:#{EOL})?#{boundary}(#{EOL}|--)/n) do
diff --git a/lang/ruby18/Makefile b/lang/ruby18/Makefile
index e1558869f663..e574bcfbde30 100644
--- a/lang/ruby18/Makefile
+++ b/lang/ruby18/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ruby${RUBY_R}
PORTVERSION= ${RUBY_PORTVERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= ${MASTER_SITE_SUBDIR_RUBY}
diff --git a/lang/ruby18/files/patch-cgi.rb b/lang/ruby18/files/patch-cgi.rb
new file mode 100644
index 000000000000..b12660ce0baa
--- /dev/null
+++ b/lang/ruby18/files/patch-cgi.rb
@@ -0,0 +1,27 @@
+--- lib/cgi.rb 2004/07/28 13:26:01 1.68.2.6
++++ lib/cgi.rb 2004/10/27 02:46:50 1.68.2.7
+@@ -284,7 +284,7 @@ class CGI
+ # Standard internet newline sequence
+ EOL = CR + LF
+
+- REVISION = '$Id: cgi.rb,v 1.68.2.6 2004/07/28 13:26:01 matz Exp $' #:nodoc:
++ REVISION = '$Id: cgi.rb,v 1.68.2.7 2004/10/27 02:46:50 matz Exp $' #:nodoc:
+
+ NEEDS_BINMODE = true if /WIN/ni.match(RUBY_PLATFORM)
+
+@@ -1012,10 +1012,13 @@ def read_multipart(boundary, content
+ end
+
+ c = if bufsize < content_length
+- stdinput.read(bufsize) or ''
++ stdinput.read(bufsize)
+ else
+- stdinput.read(content_length) or ''
++ stdinput.read(content_length)
+ end
++ if c.nil?
++ raise EOFError, "bad content body"
++ end
+ buf.concat(c)
+ content_length -= c.size
+ end