1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_intern): allow zero length symbols.

[ruby-core:08861]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-09-14 07:36:53 +00:00
parent 23d2c8b624
commit 2a23c281a1
2 changed files with 5 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Thu Sep 14 16:34:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_intern): allow zero length symbols.
[ruby-core:08861]
Thu Sep 14 16:11:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Sep 14 16:11:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_intern): raise SecurityError only when $SAFE * string.c (rb_str_intern): raise SecurityError only when $SAFE

View file

@ -4148,9 +4148,6 @@ rb_str_intern(VALUE s)
volatile VALUE str = s; volatile VALUE str = s;
ID id; ID id;
if (!RSTRING_PTR(str) || RSTRING_LEN(str) == 0) {
rb_raise(rb_eArgError, "interning empty string");
}
if (OBJ_TAINTED(str) && rb_safe_level() >= 1 && !rb_sym_interned_p(str)) { if (OBJ_TAINTED(str) && rb_safe_level() >= 1 && !rb_sym_interned_p(str)) {
rb_raise(rb_eSecurityError, "Insecure: can't intern tainted string"); rb_raise(rb_eSecurityError, "Insecure: can't intern tainted string");
} }