From 052f204dcbb3d02509a47e8bd559a444a3f81160 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Fri, 9 Apr 2010 16:09:55 +0000 Subject: * ext/psych/parser.c: parse raises a TypeError when nil is passed in. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/parser.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/psych') diff --git a/ext/psych/parser.c b/ext/psych/parser.c index dd64c25101..5f5b2537c6 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -57,6 +57,7 @@ static VALUE parse(VALUE self, VALUE yaml) if(rb_respond_to(yaml, id_read)) { yaml_parser_set_input(&parser, io_reader, (void *)yaml); } else { + Check_Type(yaml, T_STRING); yaml_parser_set_input_string( &parser, (const unsigned char *)StringValuePtr(yaml), -- cgit v1.2.3