summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/string.c b/string.c
index 83ac1e486c..681614b133 100644
--- a/string.c
+++ b/string.c
@@ -4404,6 +4404,9 @@ rb_str_intern(s)
}
if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len)
rb_raise(rb_eArgError, "symbol string may not contain `\\0'");
+ if (OBJ_TAINTED(str)) {
+ rb_raise(rb_eSecurityError, "Insecure: can't intern tainted string");
+ }
id = rb_intern(RSTRING(str)->ptr);
return ID2SYM(id);
}