Project

General

Profile

Actions

Bug #9158

closed

bug in rb_readlink() in file.c (fixed)

Added by nowacki (Maciek Nowacki) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
trunk
[ruby-core:58587]

Description

Hello,

Here is a cute bug that has existed for a little while in file.c . Ruby will tend to crash when File.readlink() is called on a symlink with a long target. Fix:

--- - 2013-11-25 22:10:59.694183795 -0700
+++ file.c 2013-11-25 22:10:03.076352889 -0700
@@ -2529,8 +2529,8 @@
|| (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */
#endif
) {

  • rb_str_modify_expand(v, size);
    size *= 2;
  • rb_str_modify_expand(v, size);
    }
    if (rv < 0) {
    rb_str_resize(v, 0);

Maciek Nowacki
Application Support Analyst
Information Services & Technology
University of Alberta


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #9157: rb_readlink() calls rb_str_modify_expand() too earlyClosed11/26/2013Actions

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Closed
  • ruby -v set to trunk
Actions

Also available in: Atom PDF

Like0
Like0