diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-23 03:12:12 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-23 03:12:12 +0000 |
commit | 5859f1497e640941a2f8b78ea22434605adad4b0 (patch) | |
tree | c7b721eab4b41476cb68b5fd5a4b15bee13c2e63 /lib | |
parent | 36f1477f3faef4c1af37a6799d945c8499dd4217 (diff) |
merge revision(s) 27388:27390:
* lib/resolv.rb (Resolv::IPv4::Regex): make it only accept 0 to 255.
[ruby-core:29501]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/resolv.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb index a0e056b5d3..dc92852907 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -2086,7 +2086,11 @@ class Resolv ## # Regular expression IPv4 addresses must match. - Regex = /\A(\d+)\.(\d+)\.(\d+)\.(\d+)\z/ + Regex256 = /0 + |1(?:[0-9][0-9]?)? + |2(?:[0-4][0-9]?|5[0-5]?|[6-9])? + |[3-9][0-9]?/x + Regex = /\A(#{Regex256})\.(#{Regex256})\.(#{Regex256})\.(#{Regex256})\z/ def self.create(arg) case arg |