diff --git a/ChangeLog b/ChangeLog index cb903e31ba..9a432b5e6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Nov 18 15:56:55 2008 Yukihiro Matsumoto + + * 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 * 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")