Project

General

Profile

Actions

Bug #4586

closed

Missing length check in rb_str_each_line?

Added by now (Nikolai Weibull) about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
-
Backport:
[ruby-core:35815]

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

Actions #1

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

Also available in: Atom PDF

Like0
Like0