From 60ca258a824c1d4b6a2a40ab91d9e1286914ebf3 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 13 Dec 2015 09:28:51 +0000 Subject: psych_emitter.c: check tags range * ext/psych/psych_emitter.c (start_document): should not exceed tags array range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_emitter.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/psych') diff --git a/test/psych/test_emitter.rb b/test/psych/test_emitter.rb index fe198bd1b1..b19501932b 100644 --- a/test/psych/test_emitter.rb +++ b/test/psych/test_emitter.rb @@ -90,5 +90,20 @@ module Psych @emitter.start_sequence(nil, nil, true, :foo) end end + + def test_resizing_tags + tags = [] + version = [1,1] + obj = Object.new + obj.instance_variable_set(:@tags, tags) + def obj.to_str + (1..10).map{|x| @tags.push(["AAAA","BBBB"])} + return "x" + end + + tags.push([obj, "tag:TALOS"]) + @emitter.start_document(version, tags, 0) + assert(true) + end end end -- cgit v1.2.3