Project

General

Profile

Bug #14756

`Exception` may cause SEGV when `#backtrace` returns a string

Added by yui-knk (Kaneko Yuichiro) about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-05-13 trunk 63413) [x86_64-linux]
[ruby-core:87013]

Description

This code causes SEGV, because print_backtrace expects second argument to be an array but a string is given.

class Exception
  def backtrace
    "backtrace"
  end
end

"".a

Also in ruby 2.3.7, 2.4.4, 2.5.1.

Also available in: Atom PDF