aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2022-08-07 03:01:40 +0900
committerchibash <chiba@javassist.org>2022-08-07 03:01:40 +0900
commit4f35e4e1a8c76fa7da07a92674ffddd5c4c27ec0 (patch)
treee80a7204fbc4e4e428dd69887248e564b560b159 /src/main/javassist/bytecode
parent7bbf0d4244011baa0dfb6f5116b659cab514cc9a (diff)
downloadjavassist-4f35e4e1a8c76fa7da07a92674ffddd5c4c27ec0.tar.gz
javassist-4f35e4e1a8c76fa7da07a92674ffddd5c4c27ec0.zip
prohibits too many items from being added to a constant pool
Diffstat (limited to 'src/main/javassist/bytecode')
-rw-r--r--src/main/javassist/bytecode/ConstPool.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/ConstPool.java b/src/main/javassist/bytecode/ConstPool.java
index 1ce26b3e..b5113e42 100644
--- a/src/main/javassist/bytecode/ConstPool.java
+++ b/src/main/javassist/bytecode/ConstPool.java
@@ -1433,6 +1433,9 @@ public final class ConstPool
*/
public void write(DataOutputStream out) throws IOException
{
+ if (numOfItems < 0 || Short.MAX_VALUE < numOfItems)
+ throw new IOException("too many constant pool items " + numOfItems);
+
out.writeShort(numOfItems);
LongVector v = items;
int size = numOfItems;