[前][次][番号順一覧][スレッド一覧]

ruby-changes:42330

From: naruse <ko1@a...>
Date: Tue, 29 Mar 2016 22:59:42 +0900 (JST)
Subject: [ruby-changes:42330] naruse:r54404 (ruby_2_3): merge revision(s) 53363: [Backport #11910] [Backport #12061]

naruse	2016-03-29 22:59:37 +0900 (Tue, 29 Mar 2016)

  New Revision: 54404

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54404

  Log:
    merge revision(s) 53363: [Backport #11910] [Backport #12061]
    
    * lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
    
    * test/resolv/test_dns.rb (test_ipv6_create): test for above
      [Bug #11910] [ruby-core:72559]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/lib/resolv.rb
    branches/ruby_2_3/test/resolv/test_dns.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/lib/resolv.rb
===================================================================
--- ruby_2_3/lib/resolv.rb	(revision 54403)
+++ ruby_2_3/lib/resolv.rb	(revision 54404)
@@ -2451,14 +2451,14 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_3/lib/resolv.rb#L2451
       when IPv6
         return arg
       when String
-        address = ''
+        address = ''.b
         if Regex_8Hex =~ arg
           arg.scan(/[0-9A-Fa-f]+/) {|hex| address << [hex.hex].pack('n')}
         elsif Regex_CompressedHex =~ arg
           prefix = $1
           suffix = $2
-          a1 = ''
-          a2 = ''
+          a1 = ''.b
+          a2 = ''.b
           prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
           suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
           omitlen = 16 - a1.length - a2.length
@@ -2474,8 +2474,8 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_3/lib/resolv.rb#L2474
         elsif Regex_CompressedHex4Dec =~ arg
           prefix, suffix, a, b, c, d = $1, $2, $3.to_i, $4.to_i, $5.to_i, $6.to_i
           if (0..255) === a && (0..255) === b && (0..255) === c && (0..255) === d
-            a1 = ''
-            a2 = ''
+            a1 = ''.b
+            a2 = ''.b
             prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
             suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
             omitlen = 12 - a1.length - a2.length
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54403)
+++ ruby_2_3/version.h	(revision 54404)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.0"
 #define RUBY_RELEASE_DATE "2016-03-29"
-#define RUBY_PATCHLEVEL 52
+#define RUBY_PATCHLEVEL 53
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54403)
+++ ruby_2_3/ChangeLog	(revision 54404)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Tue Mar 29 22:56:44 2016  Eric Wong  <e@8...>
+
+	* lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
+	* test/resolv/test_dns.rb (test_ipv6_create): test for above
+	  [Bug #11910] [ruby-core:72559]
+
 Tue Mar 29 22:31:48 2016  Shugo Maeda  <shugo@r...>
 
 	* range.c (range_eqq): revert r11113 because rb_call_super() is
Index: ruby_2_3/test/resolv/test_dns.rb
===================================================================
--- ruby_2_3/test/resolv/test_dns.rb	(revision 54403)
+++ ruby_2_3/test/resolv/test_dns.rb	(revision 54404)
@@ -199,6 +199,12 @@ class TestResolvDNS < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/resolv/test_dns.rb#L199
     assert_equal(expected, labels)
   end
 
+  def test_ipv6_create
+    ref = '[Bug #11910] [ruby-core:72559]'
+    assert_instance_of Resolv::IPv6, Resolv::IPv6.create('::1')
+    assert_instance_of Resolv::IPv6, Resolv::IPv6.create('::1:127.0.0.1')
+  end
+
   def test_too_big_label_address
     n = 2000
     m = Resolv::DNS::Message::MessageEncoder.new {|msg|

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53363


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]