Language: Java
Label: vulnerable
CWE: CWE-502 \u2014 Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

Code:
	public void readData(LPDataInput input) throws IOException {
		mode = TargetMode.values()[input.readByte()];
		int size = input.readInt();
		additions = new Object[size];
		for (int i = 0; i < size; i++) {
			byte[] bytes = input.readByteArray();
			ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
			ObjectInput in = new ObjectInputStream(bis);
			try {
				Object o = in.readObject();
				additions[i] = o;
			} catch (ClassNotFoundException e) {
				throw new UnsupportedOperationException(e);
			}
		}
	}