File tree 4 files changed +12
-8
lines changed
4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change
1
+ Mon Jun 30 02:28:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
2
+
3
+ * io.c (io_setstrbuf): always check if the buffer is modifiable.
4
+ [ruby-core:62643] [Bug #9847]
5
+
1
6
Mon Jun 30 02:25:00 2014 Tanaka Akira <akr@fsij.org>
2
7
3
8
* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#accept):
Original file line number Diff line number Diff line change @@ -2290,8 +2290,8 @@ io_setstrbuf(VALUE *str, long len)
2290
2290
VALUE s = StringValue (* str );
2291
2291
long clen = RSTRING_LEN (s );
2292
2292
if (clen >= len ) {
2293
+ rb_str_modify (s );
2293
2294
if (clen != len ) {
2294
- rb_str_modify (s );
2295
2295
rb_str_set_len (s , len );
2296
2296
}
2297
2297
return ;
Original file line number Diff line number Diff line change @@ -2790,25 +2790,24 @@ def test_advise_pipe
2790
2790
2791
2791
def assert_buffer_not_raise_shared_string_error
2792
2792
bug6764 = '[ruby-core:46586]'
2793
+ bug9847 = '[ruby-core:62643] [Bug #9847]'
2793
2794
size = 28
2794
2795
data = [ *"a" .."z" , *"A" .."Z" ] . shuffle . join ( "" )
2795
2796
t = Tempfile . new ( "test_io" )
2796
2797
t . write ( data )
2797
2798
t . close
2798
- w = Tempfile . new ( "test_io" )
2799
+ w = [ ]
2799
2800
assert_nothing_raised ( RuntimeError , bug6764 ) do
2801
+ buf = ''
2800
2802
File . open ( t . path , "r" ) do |r |
2801
- buf = ''
2802
2803
while yield ( r , size , buf )
2803
- w << buf
2804
+ w << buf . dup
2804
2805
end
2805
2806
end
2806
2807
end
2807
- w . close
2808
- assert_equal ( data , w . open . read , bug6764 )
2808
+ assert_equal ( data , w . join ( "" ) , bug9847 )
2809
2809
ensure
2810
2810
t . close!
2811
- w . close!
2812
2811
end
2813
2812
2814
2813
def test_read_buffer_not_raise_shared_string_error
Original file line number Diff line number Diff line change 1
1
#define RUBY_VERSION "2.1.2"
2
2
#define RUBY_RELEASE_DATE "2014-06-30"
3
- #define RUBY_PATCHLEVEL 151
3
+ #define RUBY_PATCHLEVEL 152
4
4
5
5
#define RUBY_RELEASE_YEAR 2014
6
6
#define RUBY_RELEASE_MONTH 6
You can’t perform that action at this time.
0 commit comments