summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-13 06:21:47 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-13 06:21:47 +0000
commit438c4a6fdc5044cdf8f3b43684343a1de0d3efc2 (patch)
tree6d660a34df038d0fbad19ff04f5b4e126731b653 /io.c
parent81737565b1b3389013abbd49c05152e5c05b365a (diff)
downloadruby-438c4a6fdc5044cdf8f3b43684343a1de0d3efc2.tar.gz
* io.c (rb_f_syscall): Fix buffer overflow with syscall
arguments. [ruby-bugs:PR#8541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io.c b/io.c
index fa44bf93e1..e98520da36 100644
--- a/io.c
+++ b/io.c
@@ -5046,6 +5046,8 @@ rb_f_syscall(argc, argv)
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);