summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-19 18:43:32 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-19 18:43:32 +0900
commitc4268f67d052aa55f9cce3307d846285f1e6519b (patch)
tree319121418553c111119f4b7122aca0bd4cfebe63 /src
parent54c2dcf231f1dce1972a3b55fee1123ff8ff0229 (diff)
downloadmruby-c4268f67d052aa55f9cce3307d846285f1e6519b.tar.gz
mruby-c4268f67d052aa55f9cce3307d846285f1e6519b.zip
UINT16_MAX as symbol length is reserved; ref #2294
Diffstat (limited to 'src')
-rw-r--r--src/symbol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/symbol.c b/src/symbol.c
index cf8f549c5..148adc6fe 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -43,7 +43,7 @@ sym_intern(mrb_state *mrb, const char *name, size_t len, mrb_bool lit)
mrb_sym sym;
char *p;
- if (len > UINT16_MAX) {
+ if (len > (UINT16_MAX-1)) { /* UINT16_MAX is reverved */
mrb_raise(mrb, E_ARGUMENT_ERROR, "symbol length too long");
}
sname.lit = lit;