* ext/syck/rubyext.c (syck_scalar_value_set): should set newly

allocated memory instead of RString's internal storage.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-12-16 03:17:16 +00:00
parent f4f242b6d2
commit 87ea59c208
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,8 @@ Fri Dec 16 11:44:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/rubyext.c (syck_node_type_id_set): should set newly * ext/syck/rubyext.c (syck_node_type_id_set): should set newly
allocated memory instead of RString's internal storage. allocated memory instead of RString's internal storage.
* ext/syck/rubyext.c (syck_scalar_value_set): ditto.
... these fixes won't fix [ruby-dev:27839]. more work is needed. ... these fixes won't fix [ruby-dev:27839]. more work is needed.
Thu Dec 15 12:35:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Dec 15 12:35:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org>

View File

@ -1522,7 +1522,7 @@ syck_scalar_value_set( self, val )
Data_Get_Struct( self, SyckNode, node ); Data_Get_Struct( self, SyckNode, node );
StringValue( val ); StringValue( val );
node->data.str->ptr = RSTRING(val)->ptr; node->data.str->ptr = syck_strndup( RSTRING(val)->ptr, RSTRING(val)->len );
node->data.str->len = RSTRING(val)->len; node->data.str->len = RSTRING(val)->len;
node->data.str->style = scalar_none; node->data.str->style = scalar_none;