summaryrefslogtreecommitdiff
path: root/ext/psych/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/parser.c')
-rw-r--r--ext/psych/parser.c1
1 files changed, 1 insertions, 0 deletions
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),