Actions
Bug #4586
closedMissing length check in rb_str_each_line?
Description
=begin
In rb_str_each line, the following test is performed:
(rslen <= 1 || memcmp(RSTRING_PTR(rs), p, rslen) == 0)
Shouldn’t it be
(rslen <= 1 ||
(pend - p >= rslen && memcmp(RSTRING_PTR(rs), p, rslen) == 0))
?
=end
Updated by naruse (Yui NARUSE) about 13 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r31310.
Nikolai, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- string.c (rb_str_each_line): check string's length when compare
separator and string. [ruby-core:35815] fixes #4586
=end
Actions
Like0
Like0