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 LaserData readData(LPDataInput input) throws IOException {
		posX = input.readInt();
		posY = input.readInt();
		posZ = input.readInt();
		dir = ForgeDirection.values()[input.readByte()];
		finalPipe = input.readBoolean();
		startPipe = input.readBoolean();
		length = input.readInt();
		connectionType = EnumSet.noneOf(PipeRoutingConnectionType.class);
		for (PipeRoutingConnectionType type : PipeRoutingConnectionType.values()) {
			if (input.readBoolean()) {
				connectionType.add(type);
			}
		}
		return this;
	}