diff options
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/variable.c b/variable.c index e3da3615f0..177f61c76d 100644 --- a/variable.c +++ b/variable.c @@ -1337,6 +1337,8 @@ rb_cvar_set(klass, id, val) { VALUE tmp; + if (!OBJ_TAINTED(klass) && rb_safe_level() >= 4) + rb_raise(rb_eSecurityError, "Insecure: can't modify class variable"); if (FL_TEST(klass, FL_SINGLETON)) { klass = rb_iv_get(klass, "__attached__"); } |