Project

General

Profile

Actions

Backport #6853

closed

Regular Expression Bug

Added by zhangb (Bushi Zhang) over 11 years ago. Updated over 11 years ago.

Status:
Closed
[ruby-core:47115]

Description

I'm getting a seg fault with the following code:

resources :products, :only => %w(show) do
collection do
get ':user_platform/:app_guid(/:template)', :action => 'index', :as => '',
:defaults => { :template => 'appwall' },
:constraints => { :user_platform => /[a-z][a-z0-9-\s]+/i, :app_guid => /[0-9a-z-.]+/i }
end
end

The culprit is the line with :constraints, specifically the trailing '-' in user_platform.

I tested the expression on Rubular and it's not a problem. Older versions of ruby will return a warning but won't crash. Removing the '-' fixes the problem.


Files

ruby_2012-08-10-115737_Bushis-MacBook-Pro.crash (19.5 KB) ruby_2012-08-10-115737_Bushis-MacBook-Pro.crash crashreporter zhangb (Bushi Zhang), 08/11/2012 01:22 AM
2012-08-10-crash.csv (164 KB) 2012-08-10-crash.csv output from console zhangb (Bushi Zhang), 08/11/2012 01:22 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0