Forum: Ruby Iconv buffer overflow?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Victor S. (Guest)
on 2006-05-29 18:34
(Received via mailing list)
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.
Yukihiro M. (Guest)
on 2006-05-29 20:08
(Received via mailing list)
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.
Victor S. (Guest)
on 2006-05-30 00:56
(Received via mailing list)
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.
Nobuyoshi N. (Guest)
on 2006-05-30 08:19
(Received via mailing list)
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.
Victor S. (Guest)
on 2006-05-30 14:58
(Received via mailing list)
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 :)

> Nobu Nakada

Victor.
This topic is locked and can not be replied to.