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 about 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

Also available in: Atom PDF

Like0
Like0