[#7872] Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...>

All, I needed a nonblocking socket connect for my asynchronous-event

18 messages 2006/05/14
[#7873] Re: Nonblocking socket-connect — Tanaka Akira <akr@...17n.org> 2006/05/14

In article <3a94cf510605140559l7baa0205le341dac4f47d424b@mail.gmail.com>,

[#7874] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

How about introducing the method Socket#set_nonblocking, or alternatively

[#7875] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

[#7876] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

Well, it's ok then. I'm comfortable adding in the nonblocking

[#7877] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

Coverity: Patch/Fix CID 17 OVERRUN_STATIC File: ruby/signal.c

From: Kevin Tew <tewk@...>
Date: 2006-05-05 02:28:23 UTC
List: ruby-core #7823
This is a simple out of bounds array access error.
The error checking code is off by 1.  > Should be >=.
Comments and suggestions welcome.
If there are no objections, could someone commit the fix.

Kevin Tew


CID: 17
Checker: OVERRUN_STATIC (help)
File: ruby/signal.c
Function: trap
Description: Overrun of static array "trap_list" of size 65 at
position 65 with index variable "sig"

static struct {
    VALUE cmd;
    int safe;
} trap_list[NSIG];

633         if (sig < 0 || sig > NSIG) {
634             rb_raise(rb_eArgError, "invalid signal number (%d)", sig);
635         }

trap_list is only NSIG big so the "if" should be >=NSIG
Arrays are zero based in C.


Index: signal.c
===================================================================
RCS file: /src/ruby/signal.c,v
retrieving revision 1.72
diff -u -r1.72 signal.c
--- signal.c    9 Jan 2006 22:32:55 -0000       1.72
+++ signal.c    5 May 2006 02:24:42 -0000
@@ -630,7 +630,7 @@
            rb_raise(rb_eArgError, "unsupported signal SIG%s", s);
     }
 
-    if (sig < 0 || sig > NSIG) {
+    if (sig < 0 || sig >= NSIG) {
        rb_raise(rb_eArgError, "invalid signal number (%d)", sig);
     }
 #if defined(HAVE_SETITIMER)


In This Thread

Prev Next