1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/-ext-/string
nagachika 641e384341 merge revision(s) 93faa011d3: [Backport #16151]
Tag string shared roots to fix use-after-free

	The buffer deduplication codepath in rb_fstring can be used to free the buffer
	of shared string roots, which leads to use-after-free.

	Introudce a new flag to tag strings that at one point have been a shared root.
	Check for it in rb_fstring to avoid freeing buffers that are shared by
	multiple strings. This change is based on nobu's idea in [ruby-core:94838].

	The included test case test for the sequence of calls to internal functions
	that lead to this bug. See attached ticket for Ruby level repros.

	[Bug #16151]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-09-27 11:23:18 +00:00
..
test_capacity.rb
test_coderange.rb
test_cstr.rb
test_ellipsize.rb
test_enc_associate.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_enc_str_buf_cat.rb
test_external_new.rb Add test for Bug::String.buf_new 2017-12-03 12:06:16 +00:00
test_fstring.rb merge revision(s) 93faa011d3: [Backport #16151] 2019-09-27 11:23:18 +00:00
test_modify_expand.rb
test_nofree.rb
test_normalize.rb
test_qsort.rb
test_rb_str_dup.rb merge revision(s) 3f9562015e651735bfc2fdd14e8f6963b673e22a,c06ddfee878524168e4af07443217ed2f8d0954b,3b3b4a44e57dfe03ce3913009d69a33d6f6100be: [Backport #15792] 2019-08-07 11:45:24 +00:00
test_set_len.rb