summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-25 07:08:45 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-25 07:08:45 (GMT)
commitc416efa440560feeabc5736f42f270534bfabafe (patch)
treecc456574a2cc68901ca957a500a232687807c747 /hash.c
parent08b54fbd0dcb1c436a79a4cc9a0ac892cc0c8239 (diff)
hash.c: GC guards
* hash.c (env_delete, env_aset): prevent environment variable names from GC while ruby_setenv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index bc689a5..ae1051d 100644
--- a/hash.c
+++ b/hash.c
@@ -2816,6 +2816,7 @@ env_delete(VALUE obj, VALUE name)
ruby_setenv(nam, 0);
if (ENVMATCH(nam, PATH_ENV)) {
+ RB_GC_GUARD(name);
path_tainted = 0;
}
return value;
@@ -3151,6 +3152,7 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
ruby_setenv(name, value);
if (ENVMATCH(name, PATH_ENV)) {
+ RB_GC_GUARD(nm);
if (OBJ_TAINTED(val)) {
/* already tainted, no check */
path_tainted = 1;