Iconv buffer overflow?


#1

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.


#2

Hi,

In message “Re: Iconv buffer overflow?”
on Mon, 29 May 2006 23:32:48 +0900, “Victor S.”
removed_email_address@domain.invalid 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.

#3

From: Yukihiro M. [mailto:removed_email_address@domain.invalid]
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.


#4

Hi,

2006/5/30, Victor S. removed_email_address@domain.invalid:

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.


#5

From: removed_email_address@domain.invalid [mailto:removed_email_address@domain.invalid] 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.