[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01741] Re: [Ruby] static buffers

From: Yukihiro Matsumoto <matz@...>
Date: 2000-03-06 03:42:50 UTC
List: ruby-talk #1741
The following message is a courtesy copy of an article
that has been posted to comp.lang.misc as well.

Hi,

Muvaw Pnazte <bugathlon@yahoo.com> writes:

|	host = Socket.gethostbyname("domain.com\n") 
|
|which threw the exception. No wonder. (Maybe a little uninformative
|though. :)

I'll give you more informative error message in the next release.

|Actually I don't see. Maybe I should have emphasized it, but what I
|meant was that I thought we are entering to the last row of the block I
|copied, strcpy, and it can overflow. (I though variable name is not
|empty string, nor "<broadcast\0" so we enter else block.) I didn't check
|it then though. So I checked it now and there could be something wrong
|in my code, but I think this (patch, ruby, output) proves my point:

You are right.  It still has a possible buffer overrun.  sigh.
I fixed it.  Thank you.

|Both are ok. I could argue that first is bad because of "overloaded" use
|of the "=> operator" and the second is bad because "in" is already used
|in other context. But both are ok for me. I could throw one more of
|these forms:
|
|	rescue FriendlyException to friendly

Introducing new keyword may raise serious compatibility problem.
But I'll consider it too.

							matz.

In This Thread

Prev Next