diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-18 06:58:55 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-18 06:58:55 +0000 |
commit | 9d2ecf3d905bf8d304b9bf42a2046f04bdf2738e (patch) | |
tree | 0822df935f3a77eda56d94dd7f21c15feda69799 | |
parent | 4ccfa1e9f8c99d28863b7de6f10eaf718cac49c7 (diff) | |
download | ruby-9d2ecf3d905bf8d304b9bf42a2046f04bdf2738e.tar.gz |
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_request_line):
use possessive match for path retrieval to avoid huge recursion
for insanely long path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/webrick/httprequest.rb | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Tue Nov 18 15:56:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_request_line): + use possessive match for path retrieval to avoid huge recursion + for insanely long path. + Tue Nov 18 15:50:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * re.c (rb_reg_desc): re might be NULL. diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index 889a83abe4..3a8d744016 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -249,7 +249,7 @@ module WEBrick end @request_time = Time.now raise HTTPStatus::EOFError unless @request_line - if /^(\S+)\s+(\S+)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line + if /^(\S+)\s+(\S++)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line @request_method = $1 @unparsed_uri = $2 @http_version = HTTPVersion.new($3 ? $3 : "0.9") |