On Sat, Feb 10, 2007 at 02:31:48AM +0900, noreply / rubyforge.org wrote:
> $ r -e 'syscall(0, 1, 2, 3, 4, 5, 6, 7, 8)'

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).

sroberts@pebble:~/s/ruby/svn-ruby-1.8.5% svn diff io.c                                   
Index: io.c
===================================================================
--- io.c        (revision 11598)
+++ io.c        (working copy)
@@ -5049,7 +5049,10 @@
        rb_raise(rb_eArgError, "too few arguments for syscall");
     arg[0] = NUM2LONG(argv[0]); argv++;
     while (items--) {
-       VALUE v = rb_check_string_type(*argv);
+       VALUE v;
+       if(i >= sizeof(arg)/sizeof(arg[0]))
+           rb_raise(rb_eArgError, "too many arguments for syscall");
+               v = rb_check_string_type(*argv);
 
        if (!NIL_P(v)) {
            StringValue(v);

sroberts@pebble:~/s/ruby/svn-ruby-1.8.5% ./ruby1.8.x -e 'syscall(0,1,2,3,4,5,6,7,8,9,10)'
-e:1:in `syscall': too many arguments for syscall (ArgumentError)
        from -e:1