File tree Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Original file line number Diff line number Diff line change
1
+ Thu Dec 23 12:22:35 2010 Tanaka Akira <akr@fsij.org>
2
+
3
+ * lib/resolv.rb (Resolv::IPv4::Regex): make it only accept 0 to 255.
4
+ [ruby-core:29501]
5
+
1
6
Tue Dec 21 01:43:01 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
2
7
3
8
* lib/webrick/https.rb: uninitialized instance variables.
Original file line number Diff line number Diff line change @@ -2066,7 +2066,11 @@ class IPv4
2066
2066
##
2067
2067
# Regular expression IPv4 addresses must match.
2068
2068
2069
- Regex = /\A (\d +)\. (\d +)\. (\d +)\. (\d +)\z /
2069
+ Regex256 = /0
2070
+ |1(?:[0-9][0-9]?)?
2071
+ |2(?:[0-4][0-9]?|5[0-5]?|[6-9])?
2072
+ |[3-9][0-9]?/x
2073
+ Regex = /\A (#{ Regex256 } )\. (#{ Regex256 } )\. (#{ Regex256 } )\. (#{ Regex256 } )\z /
2070
2074
2071
2075
def self . create ( arg )
2072
2076
case arg
Original file line number Diff line number Diff line change
1
+ require 'test/unit'
2
+ require 'resolv'
3
+ require 'socket'
4
+
5
+ class TestResolvAddr < Test ::Unit ::TestCase
6
+ def test_invalid_ipv4_address
7
+ assert ( Resolv ::IPv4 ::Regex !~ "1.2.3.256" , "[ruby-core:29501]" )
8
+ 1000 . times { |i |
9
+ if i < 256
10
+ assert ( Resolv ::IPv4 ::Regex =~ "#{ i } .#{ i } .#{ i } .#{ i } " )
11
+ else
12
+ assert ( Resolv ::IPv4 ::Regex !~ "#{ i } .#{ i } .#{ i } .#{ i } " )
13
+ end
14
+ }
15
+ end
16
+ end
Original file line number Diff line number Diff line change 1
1
#define RUBY_VERSION "1.8.7"
2
- #define RUBY_RELEASE_DATE "2010-12-21 "
2
+ #define RUBY_RELEASE_DATE "2010-12-23 "
3
3
#define RUBY_VERSION_CODE 187
4
- #define RUBY_RELEASE_CODE 20101221
5
- #define RUBY_PATCHLEVEL 329
4
+ #define RUBY_RELEASE_CODE 20101223
5
+ #define RUBY_PATCHLEVEL 330
6
6
7
7
#define RUBY_VERSION_MAJOR 1
8
8
#define RUBY_VERSION_MINOR 8
9
9
#define RUBY_VERSION_TEENY 7
10
10
#define RUBY_RELEASE_YEAR 2010
11
11
#define RUBY_RELEASE_MONTH 12
12
- #define RUBY_RELEASE_DAY 21
12
+ #define RUBY_RELEASE_DAY 23
13
13
14
14
#ifdef RUBY_EXTERN
15
15
RUBY_EXTERN const char ruby_version [];
You can’t perform that action at this time.
0 commit comments