summaryrefslogtreecommitdiff
path: root/ext/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 20:14:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 20:14:43 +0000
commitd8d9bac5c8b071135e50ad3f21c8a9b6a9c06e54 (patch)
treeb6b957bc5a752f891d43881e303ec395d639f3db /ext/stringio
parent8cc0ee4a967af26feb0f1d723c5178cafd434ce8 (diff)
* ext/stringio/stringio.c (get_strio, strio_set_string)
(strio_reopen): check if frozen. [ruby-core:33648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio')
-rw-r--r--ext/stringio/stringio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 7edf711..208fd4d 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -85,7 +85,7 @@ static const rb_data_type_t strio_data_type = {
static struct StringIO*
get_strio(VALUE self)
{
- struct StringIO *ptr = check_strio(self);
+ struct StringIO *ptr = check_strio(rb_io_taint_check(self));
if (!ptr) {
rb_raise(rb_eIOError, "uninitialized stream");
@@ -312,7 +312,7 @@ strio_set_string(VALUE self, VALUE string)
{
struct StringIO *ptr = StringIO(self);
- if (!OBJ_TAINTED(self)) rb_secure(4);
+ rb_io_taint_check(self);
ptr->flags &= ~FMODE_READWRITE;
StringValue(string);
ptr->flags = OBJ_FROZEN(string) ? FMODE_READABLE : FMODE_READWRITE;
@@ -504,7 +504,7 @@ strio_set_lineno(VALUE self, VALUE lineno)
static VALUE
strio_reopen(int argc, VALUE *argv, VALUE self)
{
- if (!OBJ_TAINTED(self)) rb_secure(4);
+ rb_io_taint_check(self);
if (argc == 1 && TYPE(*argv) != T_STRING) {
return strio_copy(self, *argv);
}