summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 2aed90193e..9574ed31c9 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1946,6 +1946,12 @@ CODE
r.taint
a.sub!(/./, r)
assert_predicate(a, :tainted?)
+
+ bug16105 = '[Bug #16105] heap-use-after-free'
+ a = S("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345678")
+ b = a.dup
+ c = a.slice(1, 100)
+ assert_equal("AABCDEFGHIJKLMNOPQRSTUVWXYZ012345678", b.sub!(c, b), bug16105)
end
def test_succ