summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-03-25 20:28:21 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-03-25 20:28:21 +0900
commit33a9840e4a2db7b5136850f23b0185a7d0a6c9c9 (patch)
treec25862023f16ea989d2fabaaf211c14c4a274e50
parentf7e05c7d226d259eb2402d0e6c6d84233081be39 (diff)
downloadmruby-33a9840e4a2db7b5136850f23b0185a7d0a6c9c9.tar.gz
mruby-33a9840e4a2db7b5136850f23b0185a7d0a6c9c9.zip
Need to check length before packing a symbol; fix #4340
-rw-r--r--src/symbol.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/symbol.c b/src/symbol.c
index 87c4ca11e..561c5e2fb 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -53,6 +53,7 @@ sym_inline_pack(const char *name, uint16_t len)
if (p == 0) return 0; /* non alnum char */
bits = (uint32_t)(p - pack_table)+1;
if (bits > 27) lower = 0;
+ if (i >= mix_length_max) break;
sym |= bits<<(i*6+2);
}
if (lower) {