Project

General

Profile

Actions

Bug #669

closed

nil を引数にして Iconv.new を呼ぶとSEGV

Added by hiroshi (Hiroshi MORIYAMA) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
Backport:

Description

=begin
次の例のように Iconv.new や Iconv.open などの第一、又は第二引
数に nil を指定して呼ぶと、rubyが落ちます。nil の他にはシンボ
ルや true などで落ちました。パッチファイルを添付します。

例:

% ./ruby1.9 -riconv -e "Iconv.new(nil, 'UTF-8')"
-e:1: [BUG] Segmentation fault
ruby 1.9.0 (2008-10-21 revision 19843) [i686-linux]

-- control frame ----------
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :initialize
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :new
c:0003 p:0018 s:0006 b:0006 l:000005 d:000005 TOP -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17

DBG> : "-e:1:in initialize'" DBG> : "-e:1:in new'"
DBG> : "-e:1:in `'"
-- backtrace of native function call (Use addr2line) --
0x811c205
0x81486ce
0x814872b
0x80cef73
0xb7f36440
0xb7f268c7
0xb7f270ee
0x810ca3e
0x8119223
0x8119696
0x8059ca3
0x808151a
0x810ca3e
0x811a9c2
0x8112e89
0x81174db
0x8117709
0x805a27f
0x805bbbe
0x8059131
0xb7d90ea8
0x8059041

zsh: abort ./ruby1.9 -riconv -e "Iconv.new(nil, 'UTF-8')"
=end


Files

fix-segv-by-iconv-new-with-not-string.diff (2.14 KB) fix-segv-by-iconv-new-with-not-string.diff hiroshi (Hiroshi MORIYAMA), 10/21/2008 07:06 AM
Actions

Also available in: Atom PDF

Like0
Like0