aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2022-08-07 04:06:50 +0900
committerchibash <chiba@javassist.org>2022-08-07 04:06:50 +0900
commit3528a20dd925388c01330b950d0f3ad75f7a14e5 (patch)
treea91523fb9843d8c9a6e86364ab005f55f6b295fa /src/main
parent4f35e4e1a8c76fa7da07a92674ffddd5c4c27ec0 (diff)
downloadjavassist-3528a20dd925388c01330b950d0f3ad75f7a14e5.tar.gz
javassist-3528a20dd925388c01330b950d0f3ad75f7a14e5.zip
prohibits too many items from being added to a constant pool.
the previous commit was wrong.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/javassist/bytecode/ConstPool.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/javassist/bytecode/ConstPool.java b/src/main/javassist/bytecode/ConstPool.java
index b5113e42..e8434dce 100644
--- a/src/main/javassist/bytecode/ConstPool.java
+++ b/src/main/javassist/bytecode/ConstPool.java
@@ -1433,7 +1433,7 @@ public final class ConstPool
*/
public void write(DataOutputStream out) throws IOException
{
- if (numOfItems < 0 || Short.MAX_VALUE < numOfItems)
+ if (numOfItems < 0 || ((1 << 16) - 1) < numOfItems)
throw new IOException("too many constant pool items " + numOfItems);
out.writeShort(numOfItems);