Skip to content

Commit 8ea1911

Browse files
committed
Fix out of bounds read
While working on #54, I found that ASAN flags this line because this function call tries to read 53 bytes of a 50-byte string. That's not right!
1 parent 03e7410 commit 8ea1911

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/syck/rubyext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ rb_syck_bad_anchor_handler(SyckParser *p, char *a)
701701
{
702702
VALUE anchor_name = rb_str_new2( a );
703703
SyckNode *badanc = syck_new_map( rb_str_new2( "name" ), anchor_name );
704-
badanc->type_id = syck_strndup( "tag:ruby.yaml.org,2002:object:YAML::Syck::BadAlias", 53 );
704+
badanc->type_id = syck_strndup( "tag:ruby.yaml.org,2002:object:YAML::Syck::BadAlias", 50 );
705705
return badanc;
706706
}
707707

0 commit comments

Comments
 (0)