Iconv buffer overflow?

Hi all.

require ‘iconv’
max_length = 513
str = ’ ’ * max_length
Iconv.new(‘utf-8’, ‘windows-1252’).iconv(str)

Error:in `Iconv#iconv’: " " (Iconv::BrokenLibrary)

If max_length <= 512, all is OK.

  1. Is it normal?
  2. Is it documented somewhere?

Thanks.

V.

Hi,

In message “Re: Iconv buffer overflow?”
on Mon, 29 May 2006 23:32:48 +0900, “Victor S.”
[email protected] writes:

|Hi all.
|
|require ‘iconv’
|max_length = 513
|str = ’ ’ * max_length
|Iconv.new(‘utf-8’, ‘windows-1252’).iconv(str)
|
|Error:in `Iconv#iconv’: " " (Iconv::BrokenLibrary)
|
|If max_length <= 512, all is OK.
|
|1. Is it normal?
|2. Is it documented somewhere?

I suspect that it’s caused by underlying iconv library on your
platform. Could you show us your platform information?

It’s OK on my Linux box.

						matz.

From: Yukihiro M. [mailto:[email protected]]
Sent: Monday, May 29, 2006 7:07 PM

|str = ’ ’ * max_length
platform. Could you show us your platform information?

It’s OK on my Linux box.

ruby -v
ruby 1.9.0 (2006-05-01) [i386-mswin32]

V.

Hi,

2006/5/30, Victor S. [email protected]:

It’s OK on my Linux box.

ruby -v
ruby 1.9.0 (2006-05-01) [i386-mswin32]

You use wrong iconv.dll, which is linked against different
runtime DLL than which ruby is linked to.

Visual C++ 6.0 or later are binary incompatible to each others.

From: [email protected] [mailto:[email protected]] On Behalf Of
Nobuyoshi N.
Sent: Tuesday, May 30, 2006 7:19 AM

It’s OK on my Linux box.

ruby -v
ruby 1.9.0 (2006-05-01) [i386-mswin32]

You use wrong iconv.dll, which is linked against different
runtime DLL than which ruby is linked to.

Visual C++ 6.0 or later are binary incompatible to each others.

OK, thanks. I’ve recompile iconv. In fact, I have to do itearlier, but
I’m
so lazy :slight_smile:

Nobu Nakada

Victor.