Hello all,

On Sat, 10 Feb 2007 08:30:41 +0900
Sam Roberts <sroberts / uniserve.com> wrote:

> If you provide more arguments than rb_f_syscall can use on your system,
> then it won't call syscall (and it will overwrite an array on the
> stack).

I see.  It must be a Ruby side's (and typical) bug.

I fixed up the patch so that the checking is performed only once.
How about for upcoming release? > knu-san and Urabe-san

Index: io.c
===================================================================
--- io.c	(revision 11701)
+++ io.c	(working copy)
@@ -5046,6 +5046,8 @@
     rb_secure(2);
     if (argc == 0)
 	rb_raise(rb_eArgError, "too few arguments for syscall");
+    if (argc > sizeof(arg)/sizeof(arg[0]))
+	rb_raise(rb_eArgError, "too many arguments for syscall");	
     arg[0] = NUM2LONG(argv[0]); argv++;
     while (items--) {
 	VALUE v = rb_check_string_type(*argv);

--
Tadashi Saito