summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-02 03:50:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-02 03:50:53 +0000
commit6f9dcadf6e46c80bb1f807f88a691cfe388f4f8b (patch)
tree5756b304650334db0189529589f40dcd4beae38c /variable.c
parentd57bbd48f8d43b512d171f53edc198d3043d933c (diff)
* string.c (rb_str_sum): check was done with false pointer.
[ruby-dev:24383] * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/variable.c b/variable.c
index e97eef0..7844599 100644
--- a/variable.c
+++ b/variable.c
@@ -98,7 +98,7 @@ fc_i(key, value, res)
arg.klass = res->klass;
arg.track = value;
arg.prev = res;
- st_foreach(RCLASS(value)->iv_tbl, fc_i, (st_data_t)&arg);
+ st_foreach_safe(RCLASS(value)->iv_tbl, fc_i, (st_data_t)&arg);
if (arg.path) {
res->path = arg.path;
return ST_STOP;
@@ -124,7 +124,7 @@ find_class_path(klass)
arg.track = rb_cObject;
arg.prev = 0;
if (RCLASS(rb_cObject)->iv_tbl) {
- st_foreach(RCLASS(rb_cObject)->iv_tbl, fc_i, (st_data_t)&arg);
+ st_foreach_safe(RCLASS(rb_cObject)->iv_tbl, fc_i, (st_data_t)&arg);
}
if (arg.path == 0) {
st_foreach(rb_class_tbl, fc_i, (st_data_t)&arg);
@@ -958,7 +958,7 @@ rb_mark_generic_ivar_tbl()
{
if (!generic_iv_tbl) return;
if (special_generic_ivar == 0) return;
- st_foreach(generic_iv_tbl, givar_i, 0);
+ st_foreach_safe(generic_iv_tbl, givar_i, 0);
}
void
@@ -1118,7 +1118,7 @@ rb_obj_instance_variables(obj)
case T_CLASS:
case T_MODULE:
if (ROBJECT(obj)->iv_tbl) {
- st_foreach(ROBJECT(obj)->iv_tbl, ivar_i, ary);
+ st_foreach_safe(ROBJECT(obj)->iv_tbl, ivar_i, ary);
}
break;
default:
@@ -1127,7 +1127,7 @@ rb_obj_instance_variables(obj)
st_table *tbl;
if (st_lookup(generic_iv_tbl, obj, (st_data_t *)&tbl)) {
- st_foreach(tbl, ivar_i, ary);
+ st_foreach_safe(tbl, ivar_i, ary);
}
}
break;
@@ -1511,7 +1511,7 @@ rb_mod_const_at(mod, data)
tbl = st_init_numtable();
}
if (RCLASS(mod)->iv_tbl) {
- st_foreach(RCLASS(mod)->iv_tbl, sv_i, (st_data_t)tbl);
+ st_foreach_safe(RCLASS(mod)->iv_tbl, sv_i, (st_data_t)tbl);
}
return tbl;
}
@@ -1875,7 +1875,7 @@ rb_mod_class_variables(obj)
for (;;) {
if (RCLASS(obj)->iv_tbl) {
- st_foreach(RCLASS(obj)->iv_tbl, cv_i, ary);
+ st_foreach_safe(RCLASS(obj)->iv_tbl, cv_i, ary);
}
obj = RCLASS(obj)->super;
if (!obj) break;