mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/psych/parser.c: Fixing a segv in test-all. Thanks Yusuke!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7be704b359
commit
b9617bf7cb
1 changed files with 2 additions and 2 deletions
|
@ -57,10 +57,10 @@ 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);
|
||||
StringValue(yaml);
|
||||
yaml_parser_set_input_string(
|
||||
&parser,
|
||||
(const unsigned char *)StringValuePtr(yaml),
|
||||
(const unsigned char *)RSTRING_PTR(yaml),
|
||||
(size_t)RSTRING_LEN(yaml)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue