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 | 0f52ce451b8c62eaa365093d1aee3ccd61e034eb (patch) | |
tree | 0822df935f3a77eda56d94dd7f21c15feda69799 | |
parent | d3d7f940367aa5db5527b14794437238f9f1e989 (diff) | |
download | ruby-0f52ce451b8c62eaa365093d1aee3ccd61e034eb.tar.gz ruby-0f52ce451b8c62eaa365093d1aee3ccd61e034eb.tar.xz ruby-0f52ce451b8c62eaa365093d1aee3ccd61e034eb.zip |
* 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: http://svn.ruby-lang.org/repos/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 889a83abe..3a8d74401 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") |