Project

General

Profile

This project is closed and read-only.

Actions

Backport #2953

closed

nkf segfaults with --numchar-input

Backport #2953: nkf segfaults with --numchar-input

Added by nobu (Nobuyoshi Nakada) over 16 years ago. Updated over 15 years ago.


Description

=begin
http://pc12.2ch.net/test/read.cgi/tech/1267668057/375 より引用。

$ cat a.rb
require 'nkf'
sikaru = NKF.nkf('-w, --numchar-input', %w(20B9F).map{|s| "#{s};"}.join)
p sikaru
puts sikaru
$ ruby -Ku ./a.rb
a.rb:2: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]

1.8.6から1.8.8まで同様です。


Index: ext/nkf/nkf-utf8/nkf.c

--- ext/nkf/nkf-utf8/nkf.c (revision 26898)
+++ ext/nkf/nkf-utf8/nkf.c (working copy)
@@ -5005,5 +5005,5 @@ nkf_char numchar_getc(FILE *f)
nkf_char (*u)(nkf_char c ,FILE *f) = i_nungetc;
int i = 0, j;

  • nkf_char buf[8];
  • nkf_char buf[10];
    long c = -1;
    =end

Related issues 1 (0 open1 closed)

Related to Ruby - Bug #2954: wrong result of nkf with --numchar-inputClosednaruse (Yui NARUSE)Actions

Updated by nobu (Nobuyoshi Nakada) over 16 years ago Actions #1

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26903.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Updated by naruse (Yui NARUSE) over 16 years ago Actions #2

  • Status changed from Closed to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin

=end

Updated by shyouhei (Shyouhei Urabe) over 16 years ago Actions #3

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r28195.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Updated by shyouhei (Shyouhei Urabe) about 16 years ago Actions #4

  • Status changed from Closed to Assigned
  • Assignee changed from shyouhei (Shyouhei Urabe) to wyhaines (Kirk Haines)

=begin
Seems 1.8.6 also suffers this.
=end

Updated by wyhaines (Kirk Haines) about 16 years ago Actions #5

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r28242.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: PDF Atom