From 6c8ffdbf32121f49766dca934ae6be20d65d9ba6 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 17 Nov 2004 10:12:19 +0000 Subject: [PATCH] * process.c (proc_getrlimit, proc_setrlimit): add rb_secure(2) to methods of Process.{getrlimit,setrlimit} patched by Kazuhiro NISHIYAMA git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ process.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 58326c5d4c..0183b8b397 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 17 18:59:16 2004 Kazuhiro NISHIYAMA + + * process.c (proc_getrlimit, proc_setrlimit): add rb_secure(2) to + methods of Process.{getrlimit,setrlimit} + Wed Nov 17 13:05:10 2004 Nobuyoshi Nakada * dir.c (rb_push_glob): fix overrun. [ruby-dev:24886] diff --git a/process.c b/process.c index 68dd92113c..c628e4c83c 100644 --- a/process.c +++ b/process.c @@ -1971,6 +1971,8 @@ proc_getrlimit(VALUE obj, VALUE resource) #ifdef HAVE_GETRLIMIT struct rlimit rlim; + rb_secure(2); + if (getrlimit(NUM2INT(resource), &rlim) < 0) { rb_sys_fail("getrlimit"); } @@ -2016,6 +2018,8 @@ proc_setrlimit(VALUE obj, VALUE resource, VALUE rlim_cur, VALUE rlim_max) #ifdef HAVE_SETRLIMIT struct rlimit rlim; + rb_secure(2); + rlim.rlim_cur = NUM2RLIM(rlim_cur); rlim.rlim_max = NUM2RLIM(rlim_max);